I'm curently learning to create shadown using GLSL but I have some troubles here:
1. In GLSL 3.3, we can use this statement in fragment shader:
layout(location = 0) out float fragmentdepth;
to write only depth 16bit out to texture (setted as GL_DEPTH_COMPONENT16
before) but how can I do some thing like that in OpenGL 2.1 (GLSL 1.20)?
- As far as I know, for rendering depth buffer, we only need change the camera position to light position and camera direction to light direction and changed back if we are drawing real scene, Is it right?
gl_FragDepth
; I'm not sure if you won't need an extension for that. – Bartek Banachewiczgl_FragDepth
:) – Bình Nguyên