mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-16 08:02:36 +00:00
Fixed modern opengl renderer not renderering model textures, framebuffer can be used without crashing, model uv coordinates are now in buffer, minor rendering optimization
This commit is contained in:
@@ -7,6 +7,7 @@ in vec3 outColor;
|
||||
in vec4 outNormal;
|
||||
in vec3 outUV;
|
||||
in float outTextureID;
|
||||
in float outHasTexture;
|
||||
in Light outLights[MAX_LIGHTS];
|
||||
in float outTotalLights;
|
||||
in vec3 outFragPos;
|
||||
@@ -14,6 +15,8 @@ in vec3 outCameraPos;
|
||||
in vec3 outInverseNormal;
|
||||
in float outDisableLighting;
|
||||
|
||||
uniform sampler2D diffuse_texture;
|
||||
|
||||
// optimizing compilers are annoying at this stage of my understanding of GLSL
|
||||
vec4 lokiVar;
|
||||
|
||||
@@ -78,10 +81,20 @@ void main() {
|
||||
lokiVar = normalize(lokiVar);
|
||||
|
||||
vec3 result;
|
||||
if (outDisableLighting == 1.0) {
|
||||
result = outColor + 0.25;
|
||||
|
||||
if (outHasTexture == 0) {
|
||||
if (outDisableLighting == 1.0) {
|
||||
result = outColor + 0.25;
|
||||
} else {
|
||||
result = calculateLighting() * outColor;
|
||||
}
|
||||
|
||||
} else {
|
||||
result = calculateLighting() * outColor;
|
||||
if (outDisableLighting == 1.0) {
|
||||
result = texture(diffuse_texture, outUV.xy).xyz + 0.25;
|
||||
} else {
|
||||
result = calculateLighting() * texture(diffuse_texture, outUV.xy).xyz;
|
||||
}
|
||||
}
|
||||
|
||||
gl_FragColor = vec4(result, 1.0);
|
||||
|
||||
Reference in New Issue
Block a user