relief map support, small refactoring, shadow bias now based on geometry normal
This commit is contained in:
@@ -4,13 +4,16 @@ flat out uint object_flags;
|
||||
out float distance;
|
||||
out vec4 pos;
|
||||
|
||||
const vec3 luma = vec3(0.299, 0.587, 0.114);
|
||||
|
||||
void main(void) {
|
||||
object_flags = qgl_ObjectFlags;
|
||||
if (bitfieldExtract(object_flags, 2, 1) == 0)
|
||||
return;
|
||||
qgl_MaterialIndex = qgl_Material;
|
||||
qgl_FragTexture = qgl_getFragTexture();
|
||||
pos = qgl_ftransform();
|
||||
float height = dot(qgl_materialTexture(QGL_MAP_RELIEF, qgl_FragTexture, vec4(0.)).rgb, luma);
|
||||
pos = qgl_ViewProjMatrix * (qgl_ModelMatrix * (vec4(qgl_Vertex + qgl_Normal * height, 1.)));//qgl_ftransform();
|
||||
gl_Position = pos;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user