Skip to content
Snippets Groups Projects
Commit 3cdddf08 authored by Woohyung Choi's avatar Woohyung Choi
Browse files

shader 수정중

parent e28e7348
Branches
No related tags found
No related merge requests found
#version 330 core
uniform sampler2D projMap_forCam1;
uniform sampler2D image;
out vec4 FragColor;
in vec4 TexCoords;
void main (void)
{
vec4 final_color = vec4(0.0, 0.0, 0.0, 1.0);
if( gl_TexCoord[0].q > 0.0 )
vec4 final_color;
if( TexCoords.q > 0.0 )
{
vec4 ProjMapColor_forCam1 = texture2DProj(projMap_forCam1, gl_TexCoord[0]);
vec2 finalCoords = TexCoords.st / TexCoords.q;
vec4 ProjMapColor_forCam1 = texture(image, finalCoords);
final_color = ProjMapColor_forCam1;
}
gl_FragColor = final_color;
FragColor = final_color;
}
\ No newline at end of file
#version 330 core
uniform mat4 TexGenMatCam0;
uniform mat4 ViewMat;
layout (location = 0) in vec3 aPos;
out vec4 TexCoords;
uniform mat4 TexGenMatCam0;
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
void main()
{
mat4 InvViewMat = inverse(ViewMat);
vec4 posEye = gl_ModelViewMatrix * gl_Vertex;
vec4 posWorld = InvViewMat * posEye;
vec3 FragPos = vec3(model * vec4(aPos, 1.0));
vec4 VertexPos_eye = model * view * vec4(aPos, 1.0);
vec4 VertexPos_world = inverse(view) * VertexPos_eye;
gl_TexCoord[0] = TexGenMatCam0 * posWorld;
TexCoords = TexGenMatCam0 * VertexPos_world;
gl_Position = ftransform();
gl_Position = projection * view * vec4(FragPos, 1.0);
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment