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

Does "Exploding Objects" in charpter "Geometry shader" makes scense? #367

Open
crystalline02 opened this issue Aug 9, 2023 · 0 comments

Comments

@crystalline02
Copy link

crystalline02 commented Aug 9, 2023

In section "Exploding Objects", the function "vec4 explode(vec4 positon, vec3 normal)" receives parameters "position" and "normal" and returns a new vertex by offseting the "position" to some magnitude of "normal", that makes sense in world space or view space.However, in code we passed gl_in[0].gl_Positiion as "position" parameter, and caculated "normal" using other vertex's gl_Position.This means we offset positons by its normals in clip space(I think gl_Positiion caculated by vertex shader (gl_Position = projection * view * model * vec4(aPos, 1.f)) lies in clip space).So does this operation make scense in clip space?I don't know.
I also experimented with the scene, the depth value seems to get messed up.

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

No branches or pull requests

1 participant