mirror of
https://github.com/IllusionMan1212/3dobs.git
synced 2026-10-24 10:12:35 +00:00
feat: basic texture support
- add texture support (ambient, diffuse, specular) - use opacity in fragment shader - calculate normal matrix on cpu for matricies with big determinants
This commit is contained in:
+5
-1
@@ -10,11 +10,15 @@ uniform mat4 model;
|
||||
uniform mat4 view;
|
||||
uniform mat4 projection;
|
||||
uniform mat3 normalMatrix;
|
||||
uniform bool useNormalMatrix;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = projection * view * model * vec4(aPos, 1.0f);
|
||||
fragNormals = normalMatrix * aNormal;
|
||||
if (useNormalMatrix)
|
||||
fragNormals = normalMatrix * aNormal;
|
||||
else
|
||||
fragNormals = mat3(transpose(inverse(model))) * aNormal;
|
||||
fragPos = vec3(model * vec4(aPos, 1.0));
|
||||
texCoords = aTexCoords;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user