Convert gsplat material to be chunk-based#7164
Conversation
| #endif | ||
|
|
||
| // prepare the output color for the given gamma-space color | ||
| vec3 prepareOutputFromGamma(vec3 gammaColor) { |
There was a problem hiding this comment.
How does this play with render passes? Don't render passes apply a tonemap as a post effect? Also, any reason not to apply fog?
There was a problem hiding this comment.
Currently only standard-material supports fog, but I could add this to gsplat shader.
There was a problem hiding this comment.
Would be nice to support it. But I'm happy for that to be a follow up PR. We're still calling it out as a limitation in the docs after all: https://developer.playcanvas.com/user-manual/graphics/gaussian-splatting/#limitations
There was a problem hiding this comment.
as long as the generator respects the related generation options (which it seems it is), it should work .. render passes pass the options they need
|
|
||
| // instantiate guitar with a custom shader | ||
| const guitar = assets.guitar.resource.instantiate({ | ||
| fragment: files['shader.frag'], |
There was a problem hiding this comment.
I think it would be good to do the color animation in fragment shader as an example on how to do it .. it handles long splats better than per vertex.
|
With material.chunks.emissivePS = <shader_chunk_string>;Does this PR make splat shader chunk overrides more consistent with this? |
No. This PR primarily changes shader chunk layout and the way they're handled. The material is a However this also touches on GSplatComponent management, which I'm less sure of. @mvaligursky would have to comment, I think. |
mvaligursky
left a comment
There was a problem hiding this comment.
fantastic improvement!
This PR:
#includeand#ifto organise shader codeChunk breakdown as follows:
gsplat: implements main(), common to compressed and uncompressedgsplatCommon: common functionality like transforming gaussians 3d->2d and evaluating SHgsplatData,gsplatSH,gsplatColor: uncompressed data accessgsplatCompressedData,gsplatCompressedSH: compressed data accessgsplatOutput: helper function for converting to target gamma space efficientlygsplat: common to compressed and uncompressed