Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose custom shader modifications of the splat shader #5809

Merged
merged 2 commits into from Nov 9, 2023

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Nov 9, 2023

  • in vertex shader, both object and / or world space position can be modified
  • in fragment shader, the color can be modified
dancing.guitar.mov

@mvaligursky mvaligursky self-assigned this Nov 9, 2023
@mvaligursky mvaligursky added the area: graphics Graphics related issue label Nov 9, 2023
Copy link
Member

@slimbuck slimbuck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AWESOME

@@ -32,11 +32,12 @@ class SplatInstance {

lastCameraDirection = new Vec3();

constructor(splat, cameraEntity, debugRender = false) {
constructor(splat, options) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth documenting these options.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. At the moment none of the splat code has jsdocs, so that's all for a separate PR.

this.splat = splat;

// material
this.material = splat.createMaterial(debugRender);
const debugRender = options.debugRender;
this.material = splat.createMaterial(options);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good if we also supported user passing in material.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separate PR. But not sure how that would work with a compute shader implementation on WebGPU, so I would not do that yet.

@@ -63,8 +63,8 @@ class Splat {
this.centerTexture.destroy();
}

createMaterial(debugRender = false) {
const material = createSplatMaterial(this.device, debugRender);
createMaterial(options) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we should document options.

@mvaligursky mvaligursky merged commit 0338601 into main Nov 9, 2023
7 checks passed
@mvaligursky mvaligursky deleted the mv-splat-shaders branch November 9, 2023 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants