-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently only standard-material supports fog, but I could add this to gsplat shader.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -71,7 +71,6 @@ assetListLoader.load(() => { | |||
|
|||
// instantiate guitar with a custom shader | |||
const guitar = assets.guitar.resource.instantiate({ | |||
fragment: files['shader.frag'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fantastic improvement!
This PR:
#include
and#if
to 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