JoeyDeVries/LearnOpenGL

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

crystalline02 opened this issue · 0 comments

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.