Skip to content

how the vertex shader and fragment shader work? #235

Answered by mkkellogg
TopGun34 asked this question in Q&A
Discussion options

You must be logged in to vote

For the first one, which is the shader for rendering the splats, the actual calls to draw the splat geometry are in the Three.js library. I try to use Three.js where ever I can in this project and for the rendering of the splats, all I need to provide to Three.js is the shader code and some setup for the splat quad geometry (which is in the buildGeometry() function). Three.js will internally make a call to gl.drawArraysInstanced(). However, Three.js doesn't have built-in support for using transform feedback functionality, so I had to write all of it myself in raw WebGL; that is why you see the call to functions like gl.drawArrays() for that part.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@TopGun34
Comment options

Answer selected by TopGun34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants