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

Custom Shaders: let the shader control gl_PointSize #9851

Closed
ptrgags opened this issue Oct 4, 2021 · 2 comments · Fixed by #9960
Closed

Custom Shaders: let the shader control gl_PointSize #9851

ptrgags opened this issue Oct 4, 2021 · 2 comments · Fixed by #9960

Comments

@ptrgags
Copy link
Contributor

ptrgags commented Oct 4, 2021

It would be useful for custom shaders to be able to control the point size when rendering point clouds. This is available in styling language, so custom shaders should support the same.

I'm thinking:

  • add a float vsInput.pointSize to the VertexInput struct in the custom vertex shader
  • in ModelExperimentalVS.glsl should be used to set gl_PointSize if custom shaders is used (which we consider mutually exclusive with styling)
  • I'm not sure how this will interact with the point cloud attenuation... maybe the struct value would be initialized with the attenuation point size and then the custom shader could modify this value if so desired?

CC @lilleyse @sanjeetsuhag

@lilleyse
Copy link
Contributor

lilleyse commented Oct 4, 2021

I'm not sure how this will interact with the point cloud attenuation... maybe the struct value would be initialized with the attenuation point size and then the custom shader could modify this value if so desired?

Currently what happens is that the point size style overrides attenuation. Probably fine to keep it that way for custom shaders too.

@ptrgags
Copy link
Contributor Author

ptrgags commented Nov 30, 2021

I just realized what I said above is incorrect. vsInput.pointSize would be read-only, we want to make an output variable instead.

it would be better to replace the inout vec3 positionMC parameter with a struct that has both vec3 positionMC and float pointSize fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants