From d65ddd07a43d5ffdcf2ddf90d6f86626cf9b92d8 Mon Sep 17 00:00:00 2001 From: pryazha Date: Tue, 18 Mar 2025 11:31:31 +0500 Subject: hdr --- advanced_lighting/6.hdr/shaders/blinn.vert | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 advanced_lighting/6.hdr/shaders/blinn.vert (limited to 'advanced_lighting/6.hdr/shaders/blinn.vert') diff --git a/advanced_lighting/6.hdr/shaders/blinn.vert b/advanced_lighting/6.hdr/shaders/blinn.vert new file mode 100644 index 0000000..f08f38e --- /dev/null +++ b/advanced_lighting/6.hdr/shaders/blinn.vert @@ -0,0 +1,34 @@ +#version 330 core +layout(location = 0) in vec3 apos; +layout(location = 1) in vec3 anormal; +layout(location = 2) in vec2 atexc; + +out VS_OUT { + vec3 fpos; + vec3 fn; + vec2 texc; +} vsout; + +uniform mat4 proj; +uniform mat4 view; +uniform mat4 model; + +uniform bool invert_normals; + +void main(void) +{ + mat3 normtransf; + + vsout.fpos = vec3(model*vec4(apos, 1.0)); + + normtransf = mat3(transpose(inverse(model))); + + if (invert_normals) + vsout.fn = normtransf*(-anormal); + else + vsout.fn = normtransf*anormal; + + vsout.texc = atexc; + + gl_Position = proj*view*model*vec4(apos, 1.0); +} -- cgit v1.2.3