diff --git a/assets/Shaders/entities/blocksingle/block.vs b/assets/Shaders/entities/blocksingle/block.vs index 49244d7d..abc55ac9 100644 --- a/assets/Shaders/entities/blocksingle/block.vs +++ b/assets/Shaders/entities/blocksingle/block.vs @@ -1,5 +1,7 @@ //Vertex Shader -#version 330 core +#version 450 core +#extension GL_ARB_shading_language_include : require +#include "../../lib/standarduniform.fs" //defines #define TEXTURE_MAP_SCALE 1.0 @@ -13,11 +15,7 @@ layout (location = 4) in vec2 aTex; //coordinate space transformation matrices -uniform mat4 transform; uniform mat4 model; -uniform mat4 view; -uniform mat4 projection; -uniform mat4 lightSpaceMatrix; @@ -39,15 +37,15 @@ void main() { //push frag, normal, and texture positions to fragment shader FragPos = vec3(model * FinalVertex); - ViewFragPos = vec3(view * model * FinalVertex); + ViewFragPos = vec3(standardUniforms.view * model * FinalVertex); Normal = mat3(transpose(inverse(model))) * aNormal; uv = aTex; //shadow map stuff - FragPosLightSpace = lightSpaceMatrix * vec4(FragPos, 1.0); + FragPosLightSpace = standardUniforms.lightSpaceMatrix * vec4(FragPos, 1.0); //set final position with opengl space - gl_Position = projection * view * model * FinalVertex; + gl_Position = standardUniforms.projection * standardUniforms.view * model * FinalVertex; } diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index 646cbc06..5739ae78 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -2141,6 +2141,7 @@ Prevent mouse event re-allocation every frame More allocation work Frametime reporting work Raycast allocation fix +Fix single block shader