diff --git a/assets/cubyz/shaders/animation_pre_processing.glsl b/assets/cubyz/shaders/animation_pre_processing.glsl index 4397bdcd..74477dbb 100644 --- a/assets/cubyz/shaders/animation_pre_processing.glsl +++ b/assets/cubyz/shaders/animation_pre_processing.glsl @@ -17,8 +17,8 @@ layout(std430, binding = 1) buffer _animatedTexture float animatedTexture[]; }; -uniform uint time; -uniform uint size; +layout(location = 0) uniform uint time; +layout(location = 1) uniform uint size; void main() { uint textureIndex = gl_GlobalInvocationID.x; diff --git a/assets/cubyz/shaders/background/vertex.vs b/assets/cubyz/shaders/background/vertex.vs index 9041bddc..145cc346 100644 --- a/assets/cubyz/shaders/background/vertex.vs +++ b/assets/cubyz/shaders/background/vertex.vs @@ -5,8 +5,8 @@ layout(location = 1) in vec2 texCoords; layout(location = 0) out vec2 outTexCoords; -uniform mat4 viewMatrix; -uniform mat4 projectionMatrix; +layout(location = 0) uniform mat4 viewMatrix; +layout(location = 1) uniform mat4 projectionMatrix; void main() { gl_Position = projectionMatrix*viewMatrix*vec4(vertexPos, 1); diff --git a/assets/cubyz/shaders/block_selection_vertex.vs b/assets/cubyz/shaders/block_selection_vertex.vs index 668fd756..d3f1e3cc 100644 --- a/assets/cubyz/shaders/block_selection_vertex.vs +++ b/assets/cubyz/shaders/block_selection_vertex.vs @@ -4,11 +4,11 @@ layout(location = 0) in vec3 position; layout(location = 0) out vec3 mvVertexPos; -uniform mat4 projectionMatrix; -uniform mat4 viewMatrix; -uniform vec3 modelPosition; -uniform vec3 lowerBounds; -uniform vec3 upperBounds; +layout(location = 0) uniform mat4 projectionMatrix; +layout(location = 1) uniform mat4 viewMatrix; +layout(location = 2) uniform vec3 modelPosition; +layout(location = 3) uniform vec3 lowerBounds; +layout(location = 4) uniform vec3 upperBounds; void main() { vec4 mvPos = viewMatrix*vec4(lowerBounds + position*(upperBounds - lowerBounds) + modelPosition, 1); diff --git a/assets/cubyz/shaders/bloom/color_extractor_downsample.fs b/assets/cubyz/shaders/bloom/color_extractor_downsample.fs index 01f11b6e..8a01f3d5 100644 --- a/assets/cubyz/shaders/bloom/color_extractor_downsample.fs +++ b/assets/cubyz/shaders/bloom/color_extractor_downsample.fs @@ -9,12 +9,12 @@ layout(location = 2) in vec3 direction; layout(binding = 3) uniform sampler2D color; layout(binding = 4) uniform sampler2D depthTexture; -uniform float zNear; -uniform float zFar; -uniform vec2 tanXY; +layout(location = 1) uniform vec2 tanXY; +layout(location = 2) uniform float zNear; +layout(location = 3) uniform float zFar; -uniform ivec3 playerPositionInteger; -uniform vec3 playerPositionFraction; +layout(location = 4) uniform ivec3 playerPositionInteger; +layout(location = 5) uniform vec3 playerPositionFraction; struct Fog { vec3 color; @@ -23,7 +23,7 @@ struct Fog { float fogHigher; }; -uniform Fog fog; +layout(location = 6) uniform Fog fog; float zFromDepth(float depthBufferValue) { return zNear*zFar/(depthBufferValue*(zNear - zFar) + zFar); diff --git a/assets/cubyz/shaders/bloom/color_extractor_downsample.vs b/assets/cubyz/shaders/bloom/color_extractor_downsample.vs index 6ecdb34e..afbe9311 100644 --- a/assets/cubyz/shaders/bloom/color_extractor_downsample.vs +++ b/assets/cubyz/shaders/bloom/color_extractor_downsample.vs @@ -8,8 +8,8 @@ layout(location = 2) out vec3 direction; layout(binding = 3) uniform sampler2D color; -uniform mat4 invViewMatrix; -uniform vec2 tanXY; +layout(location = 0) uniform mat4 invViewMatrix; +layout(location = 1) uniform vec2 tanXY; void main() { vec2 position = inTexCoords*2 - vec2(1, 1); diff --git a/assets/cubyz/shaders/chunks/chunk_fragment.fs b/assets/cubyz/shaders/chunks/chunk_fragment.fs index 7d3eaa0f..aa197f74 100644 --- a/assets/cubyz/shaders/chunks/chunk_fragment.fs +++ b/assets/cubyz/shaders/chunks/chunk_fragment.fs @@ -11,16 +11,16 @@ layout(location = 7) flat in int ditherSeed; layout(location = 8) flat in float distanceForLodCheck; layout(location = 9) flat in int opaqueInLod; +layout(location = 0) out vec4 fragColor; + layout(binding = 0) uniform sampler2DArray textureSampler; layout(binding = 1) uniform sampler2DArray emissionSampler; layout(binding = 2) uniform sampler2DArray reflectivityAndAbsorptionSampler; layout(binding = 4) uniform samplerCube reflectionMap; -uniform float reflectionMapSize; -uniform float contrast; -uniform float lodDistance; - -layout(location = 0) out vec4 fragColor; +layout(location = 5) uniform float reflectionMapSize; +layout(location = 6) uniform float contrast; +layout(location = 7) uniform float lodDistance; layout(std430, binding = 1) buffer _animatedTexture { diff --git a/assets/cubyz/shaders/chunks/chunk_vertex.vs b/assets/cubyz/shaders/chunks/chunk_vertex.vs index 8c9395fc..a11246e6 100644 --- a/assets/cubyz/shaders/chunks/chunk_vertex.vs +++ b/assets/cubyz/shaders/chunks/chunk_vertex.vs @@ -11,11 +11,11 @@ layout(location = 7) flat out int ditherSeed; layout(location = 8) flat out float distanceForLodCheck; layout(location = 9) flat out int opaqueInLod; -uniform vec3 ambientLight; -uniform mat4 projectionMatrix; -uniform mat4 viewMatrix; -uniform ivec3 playerPositionInteger; -uniform vec3 playerPositionFraction; +layout(location = 0) uniform vec3 ambientLight; +layout(location = 1) uniform mat4 projectionMatrix; +layout(location = 2) uniform mat4 viewMatrix; +layout(location = 3) uniform ivec3 playerPositionInteger; +layout(location = 4) uniform vec3 playerPositionFraction; struct FaceData { int encodedPositionAndLightIndex; diff --git a/assets/cubyz/shaders/chunks/fillIndirectBuffer.glsl b/assets/cubyz/shaders/chunks/fillIndirectBuffer.glsl index eb945d39..824bc9a5 100644 --- a/assets/cubyz/shaders/chunks/fillIndirectBuffer.glsl +++ b/assets/cubyz/shaders/chunks/fillIndirectBuffer.glsl @@ -40,14 +40,14 @@ layout(std430, binding = 9) buffer _chunkIDs uint chunkIDs[]; }; -uniform uint chunkIDIndex; -uniform uint commandIndexStart; -uniform uint size; -uniform bool isTransparent; -uniform bool onlyDrawPreviouslyInvisible; -uniform ivec3 playerPositionInteger; +layout(location = 0) uniform uint chunkIDIndex; +layout(location = 1) uniform uint commandIndexStart; +layout(location = 2) uniform uint size; +layout(location = 3) uniform bool isTransparent; +layout(location = 4) uniform bool onlyDrawPreviouslyInvisible; +layout(location = 5) uniform ivec3 playerPositionInteger; -uniform float lodDistance; +layout(location = 6) uniform float lodDistance; bool isVisible(int dir, ivec3 playerDist) { switch(dir) { diff --git a/assets/cubyz/shaders/chunks/occlusionTestVertex.vs b/assets/cubyz/shaders/chunks/occlusionTestVertex.vs index 6e0a34a1..6eea1acb 100644 --- a/assets/cubyz/shaders/chunks/occlusionTestVertex.vs +++ b/assets/cubyz/shaders/chunks/occlusionTestVertex.vs @@ -57,10 +57,10 @@ vec3 vertexBuffer[24] = vec3[24]( vec3(0, 0, 1) ); -uniform mat4 projectionMatrix; -uniform mat4 viewMatrix; -uniform ivec3 playerPositionInteger; -uniform vec3 playerPositionFraction; +layout(location = 0) uniform mat4 projectionMatrix; +layout(location = 1) uniform mat4 viewMatrix; +layout(location = 2) uniform ivec3 playerPositionInteger; +layout(location = 3) uniform vec3 playerPositionFraction; void main() { uint chunkIDID = uint(gl_VertexID)/24u; diff --git a/assets/cubyz/shaders/chunks/transparent_fragment.fs b/assets/cubyz/shaders/chunks/transparent_fragment.fs index 54203e42..ab6e145f 100644 --- a/assets/cubyz/shaders/chunks/transparent_fragment.fs +++ b/assets/cubyz/shaders/chunks/transparent_fragment.fs @@ -11,21 +11,23 @@ layout(location = 7) flat in int ditherSeed; layout(location = 8) flat in float distanceForLodCheck; layout(location = 9) flat in int opaqueInLod; +layout(location = 0, index = 0) out vec4 fragColor; +layout(location = 0, index = 1) out vec4 blendColor; + layout(binding = 0) uniform sampler2DArray textureSampler; layout(binding = 1) uniform sampler2DArray emissionSampler; layout(binding = 2) uniform sampler2DArray reflectivityAndAbsorptionSampler; layout(binding = 4) uniform samplerCube reflectionMap; layout(binding = 5) uniform sampler2D depthTexture; -uniform float reflectionMapSize; -uniform float contrast; +layout(location = 3) uniform ivec3 playerPositionInteger; +layout(location = 4) uniform vec3 playerPositionFraction; -uniform ivec3 playerPositionInteger; -uniform vec3 playerPositionFraction; +layout(location = 5) uniform float reflectionMapSize; +layout(location = 6) uniform float contrast; - -layout(location = 0, index = 0) out vec4 fragColor; -layout(location = 0, index = 1) out vec4 blendColor; +layout(location = 8) uniform float zNear; +layout(location = 9) uniform float zFar; struct Fog { vec3 color; @@ -34,6 +36,8 @@ struct Fog { float fogHigher; }; +layout(location = 10) uniform Fog fog; + layout(std430, binding = 1) buffer _animatedTexture { float animatedTexture[]; @@ -55,11 +59,6 @@ float lightVariation(vec3 normal) { return baseLighting + dot(normal, directionalPart); } -uniform float zNear; -uniform float zFar; - -uniform Fog fog; - vec3 unpackColor(uint color) { return vec3( color>>16 & 255u, diff --git a/assets/cubyz/shaders/deferred_render_pass.fs b/assets/cubyz/shaders/deferred_render_pass.fs index 91606887..8b803ec1 100644 --- a/assets/cubyz/shaders/deferred_render_pass.fs +++ b/assets/cubyz/shaders/deferred_render_pass.fs @@ -8,12 +8,16 @@ layout(location = 1) flat in vec3[4] directions; layout(binding = 3) uniform sampler2D color; layout(binding = 4) uniform sampler2D depthTexture; -uniform float zNear; -uniform float zFar; -uniform vec2 tanXY; layout(binding = 5) uniform sampler2D bloomColor; +layout(location = 1) uniform vec2 tanXY; +layout(location = 2) uniform float zNear; +layout(location = 3) uniform float zFar; + +layout(location = 4) uniform ivec3 playerPositionInteger; +layout(location = 5) uniform vec3 playerPositionFraction; + struct Fog { vec3 color; float density; @@ -21,10 +25,7 @@ struct Fog { float fogHigher; }; -uniform Fog fog; - -uniform ivec3 playerPositionInteger; -uniform vec3 playerPositionFraction; +layout(location = 6) uniform Fog fog; float zFromDepth(float depthBufferValue) { return zNear*zFar/(depthBufferValue*(zNear - zFar) + zFar); diff --git a/assets/cubyz/shaders/deferred_render_pass.vs b/assets/cubyz/shaders/deferred_render_pass.vs index c16014d1..489b1d44 100644 --- a/assets/cubyz/shaders/deferred_render_pass.vs +++ b/assets/cubyz/shaders/deferred_render_pass.vs @@ -5,8 +5,8 @@ layout(location = 0) in vec2 inTexCoords; layout(location = 0) out vec2 texCoords; layout(location = 1) flat out vec3[4] directions; -uniform mat4 invViewMatrix; -uniform vec2 tanXY; +layout(location = 0) uniform mat4 invViewMatrix; +layout(location = 1) uniform vec2 tanXY; void main() { directions[0] = (invViewMatrix * vec4(1*tanXY.x, 1, 1*tanXY.y, 0)).xyz; diff --git a/assets/cubyz/shaders/entity_fragment.fs b/assets/cubyz/shaders/entity_fragment.fs index 33766103..bdcc46ad 100644 --- a/assets/cubyz/shaders/entity_fragment.fs +++ b/assets/cubyz/shaders/entity_fragment.fs @@ -9,7 +9,7 @@ layout(location = 0) out vec4 fragColor; layout(binding = 0) uniform sampler2D textureSampler; -uniform float contrast; +layout(location = 5) uniform float contrast; float lightVariation(vec3 normal) { const vec3 directionalPart = vec3(0, contrast/2, contrast); diff --git a/assets/cubyz/shaders/entity_vertex.vs b/assets/cubyz/shaders/entity_vertex.vs index 944aaa59..a91c59c4 100644 --- a/assets/cubyz/shaders/entity_vertex.vs +++ b/assets/cubyz/shaders/entity_vertex.vs @@ -5,11 +5,11 @@ layout(location = 1) out vec3 mvVertexPos; layout(location = 2) out vec3 outLight; layout(location = 3) flat out vec3 normal; -uniform mat4 projectionMatrix; -uniform mat4 viewMatrix; -uniform vec3 ambientLight; -uniform vec3 directionalLight; -uniform uint light; +layout(location = 0) uniform mat4 projectionMatrix; +layout(location = 1) uniform mat4 viewMatrix; +layout(location = 2) uniform vec3 ambientLight; +layout(location = 3) uniform vec3 directionalLight; +layout(location = 4) uniform uint light; struct QuadInfo { vec3 normal; diff --git a/assets/cubyz/shaders/fake_reflection.fs b/assets/cubyz/shaders/fake_reflection.fs index 6cebd89a..9d6784c0 100644 --- a/assets/cubyz/shaders/fake_reflection.fs +++ b/assets/cubyz/shaders/fake_reflection.fs @@ -4,10 +4,10 @@ layout(location = 0) in vec3 coords; layout(location = 0) out vec4 fragColor; -uniform vec3 normalVector; -uniform vec3 upVector; -uniform vec3 rightVector; -uniform float frequency; +layout(location = 1) uniform vec3 normalVector; +layout(location = 2) uniform vec3 upVector; +layout(location = 3) uniform vec3 rightVector; +layout(location = 4) uniform float frequency; ivec3 random3to3(ivec3 v) { v &= 15; diff --git a/assets/cubyz/shaders/fake_reflection.vs b/assets/cubyz/shaders/fake_reflection.vs index 597e60bd..992d6677 100644 --- a/assets/cubyz/shaders/fake_reflection.vs +++ b/assets/cubyz/shaders/fake_reflection.vs @@ -4,7 +4,7 @@ layout(location = 0) in vec2 inTexCoords; layout(location = 0) out vec3 coords; -uniform float reflectionMapSize; +layout(location = 0) uniform float reflectionMapSize; void main() { coords = vec3((inTexCoords*2 - vec2(1, 1))*(reflectionMapSize + 1)/reflectionMapSize, 1); diff --git a/assets/cubyz/shaders/graphics/Circle.vs b/assets/cubyz/shaders/graphics/Circle.vs index 0e9ba5e7..bbe6555e 100644 --- a/assets/cubyz/shaders/graphics/Circle.vs +++ b/assets/cubyz/shaders/graphics/Circle.vs @@ -5,14 +5,12 @@ layout(location = 0) in vec2 vertex_pos; layout(location = 0) out vec2 unitPosition; layout(location = 1) flat out vec4 color; - //in pixel -uniform vec2 center; -uniform float radius; -uniform vec2 screen; - -uniform int circleColor; +layout(location = 0) uniform vec2 center; +layout(location = 1) uniform float radius; +layout(location = 2) uniform vec2 screen; +layout(location = 3) uniform int circleColor; void main() { // Convert to opengl coordinates: diff --git a/assets/cubyz/shaders/graphics/Image.vs b/assets/cubyz/shaders/graphics/Image.vs index f19ef26c..b4890034 100644 --- a/assets/cubyz/shaders/graphics/Image.vs +++ b/assets/cubyz/shaders/graphics/Image.vs @@ -6,13 +6,13 @@ layout(location = 0) out vec2 uv; layout(location = 1) flat out vec4 fColor; //in pixel -uniform vec2 start; -uniform vec2 size; -uniform vec2 screen; -uniform vec2 uvOffset; -uniform vec2 uvDim; +layout(location = 0) uniform vec2 start; +layout(location = 1) uniform vec2 size; +layout(location = 2) uniform vec2 screen; +layout(location = 3) uniform vec2 uvOffset; +layout(location = 4) uniform vec2 uvDim; -uniform int color; +layout(location = 5) uniform int color; void main() { // Convert to opengl coordinates: diff --git a/assets/cubyz/shaders/graphics/Line.vs b/assets/cubyz/shaders/graphics/Line.vs index 75c9aed9..6500116d 100644 --- a/assets/cubyz/shaders/graphics/Line.vs +++ b/assets/cubyz/shaders/graphics/Line.vs @@ -5,11 +5,11 @@ layout(location = 0) in vec2 vertex_pos; layout(location = 0) flat out vec4 color; //in pixel -uniform vec2 start; -uniform vec2 direction; -uniform vec2 screen; +layout(location = 0) uniform vec2 start; +layout(location = 1) uniform vec2 direction; +layout(location = 2) uniform vec2 screen; -uniform int lineColor; +layout(location = 3) uniform int lineColor; void main() { // Convert to opengl coordinates: diff --git a/assets/cubyz/shaders/graphics/Rect.vs b/assets/cubyz/shaders/graphics/Rect.vs index 3c0a61c9..082dc128 100644 --- a/assets/cubyz/shaders/graphics/Rect.vs +++ b/assets/cubyz/shaders/graphics/Rect.vs @@ -5,11 +5,11 @@ layout(location = 0) in vec2 vertex_pos; layout(location = 0) flat out vec4 color; //in pixel -uniform vec2 start; -uniform vec2 size; -uniform vec2 screen; +layout(location = 0) uniform vec2 start; +layout(location = 1) uniform vec2 size; +layout(location = 2) uniform vec2 screen; -uniform int rectColor; +layout(location = 3) uniform int rectColor; void main() { // Convert to opengl coordinates: diff --git a/assets/cubyz/shaders/graphics/RectBorder.vs b/assets/cubyz/shaders/graphics/RectBorder.vs index 7e0177fe..c024a80a 100644 --- a/assets/cubyz/shaders/graphics/RectBorder.vs +++ b/assets/cubyz/shaders/graphics/RectBorder.vs @@ -5,12 +5,12 @@ layout(location = 0) in vec4 vertex_pos; layout(location = 0) flat out vec4 color; //in pixel -uniform vec2 start; -uniform vec2 size; -uniform vec2 screen; -uniform float lineWidth; +layout(location = 0) uniform vec2 start; +layout(location = 1) uniform vec2 size; +layout(location = 2) uniform vec2 screen; +layout(location = 3) uniform float lineWidth; -uniform int rectColor; +layout(location = 4) uniform int rectColor; void main() { // Convert to opengl coordinates: diff --git a/assets/cubyz/shaders/graphics/Text.fs b/assets/cubyz/shaders/graphics/Text.fs index 0c485f10..7e0d0b69 100644 --- a/assets/cubyz/shaders/graphics/Text.fs +++ b/assets/cubyz/shaders/graphics/Text.fs @@ -8,12 +8,12 @@ layout(location = 1) flat in vec4 color; layout(binding = 0) uniform sampler2D textureSampler; // in pixels -uniform vec4 texture_rect; -uniform vec2 scene; -uniform vec2 fontSize; -uniform vec2 offset; -uniform float ratio; -uniform int fontEffects; +layout(location = 0) uniform vec4 texture_rect; +layout(location = 1) uniform vec2 scene; +layout(location = 2) uniform vec2 offset; +layout(location = 3) uniform float ratio; +layout(location = 4) uniform int fontEffects; +layout(location = 6) uniform vec2 fontSize; vec2 convert2Proportional(vec2 original, vec2 full){ return vec2(original.x/full.x, original.y/full.y); diff --git a/assets/cubyz/shaders/graphics/Text.vs b/assets/cubyz/shaders/graphics/Text.vs index 1add40e0..18b54a7a 100644 --- a/assets/cubyz/shaders/graphics/Text.vs +++ b/assets/cubyz/shaders/graphics/Text.vs @@ -6,13 +6,13 @@ layout(location = 0) out vec2 frag_face_pos; layout(location = 1) flat out vec4 color; // in pixels -uniform vec4 texture_rect; -uniform vec2 scene; -uniform vec2 offset; -uniform float ratio; -uniform int fontEffects; +layout(location = 0) uniform vec4 texture_rect; +layout(location = 1) uniform vec2 scene; +layout(location = 2) uniform vec2 offset; +layout(location = 3) uniform float ratio; +layout(location = 4) uniform int fontEffects; -uniform float alpha; +layout(location = 5) uniform float alpha; vec2 convert2Proportional(vec2 original, vec2 full) { return vec2(original.x/full.x, original.y/full.y); diff --git a/assets/cubyz/shaders/graphics/graph.fs b/assets/cubyz/shaders/graphics/graph.fs index 9fbe370f..ad1c129b 100644 --- a/assets/cubyz/shaders/graphics/graph.fs +++ b/assets/cubyz/shaders/graphics/graph.fs @@ -2,7 +2,7 @@ layout(location = 0) out vec4 frag_color; -uniform vec3 lineColor; +layout(location = 5) uniform vec3 lineColor; void main() { frag_color = vec4(lineColor, 1); diff --git a/assets/cubyz/shaders/graphics/graph.vs b/assets/cubyz/shaders/graphics/graph.vs index 73a50cab..a0672a56 100644 --- a/assets/cubyz/shaders/graphics/graph.vs +++ b/assets/cubyz/shaders/graphics/graph.vs @@ -1,11 +1,11 @@ #version 460 //in pixel -uniform vec2 start; -uniform vec2 dimension; -uniform vec2 screen; -uniform int points; -uniform int offset; +layout(location = 0) uniform vec2 start; +layout(location = 1) uniform vec2 dimension; +layout(location = 2) uniform vec2 screen; +layout(location = 3) uniform int points; +layout(location = 4) uniform int offset; layout(std430, binding = 5) buffer _data { diff --git a/assets/cubyz/shaders/item_drop.fs b/assets/cubyz/shaders/item_drop.fs index 69921a15..fa10879e 100644 --- a/assets/cubyz/shaders/item_drop.fs +++ b/assets/cubyz/shaders/item_drop.fs @@ -18,12 +18,13 @@ layout(binding = 1) uniform sampler2DArray emissionSampler; layout(binding = 2) uniform sampler2DArray reflectivityAndAbsorptionSampler; layout(binding = 4) uniform samplerCube reflectionMap; -uniform vec3 ambientLight; -uniform mat4 projectionMatrix; -uniform float sizeScale; +layout(location = 0) uniform mat4 projectionMatrix; -uniform float reflectionMapSize; -uniform float contrast; +layout(location = 5) uniform vec3 ambientLight; +layout(location = 7) uniform float sizeScale; + +layout(location = 8) uniform float reflectionMapSize; +layout(location = 9) uniform float contrast; const float[6] normalVariations = float[6]( 1.0, diff --git a/assets/cubyz/shaders/item_drop.vs b/assets/cubyz/shaders/item_drop.vs index 2b1a50ce..9ab5775f 100644 --- a/assets/cubyz/shaders/item_drop.vs +++ b/assets/cubyz/shaders/item_drop.vs @@ -11,11 +11,11 @@ layout(location = 7) flat out int textureIndex; layout(location = 8) flat out uvec3 lower; layout(location = 9) flat out uvec3 upper; -uniform mat4 projectionMatrix; -uniform mat4 viewMatrix; -uniform mat4 modelMatrix; -uniform int modelIndex; -uniform int block; +layout(location = 0) uniform mat4 projectionMatrix; +layout(location = 1) uniform mat4 viewMatrix; +layout(location = 2) uniform mat4 modelMatrix; +layout(location = 3) uniform int modelIndex; +layout(location = 4) uniform int block; layout(std430, binding = 2) buffer _modelInfo { diff --git a/assets/cubyz/shaders/item_texture_post.fs b/assets/cubyz/shaders/item_texture_post.fs index 47923fcc..8ae297b2 100644 --- a/assets/cubyz/shaders/item_texture_post.fs +++ b/assets/cubyz/shaders/item_texture_post.fs @@ -6,7 +6,7 @@ layout(location = 0) in vec2 texCoords; layout(binding = 3) uniform sampler2D color; -uniform bool transparent; +layout(location = 0) uniform bool transparent; void main() { fragColor = texture(color, texCoords); diff --git a/assets/cubyz/shaders/skybox/star.vs b/assets/cubyz/shaders/skybox/star.vs index 77536bea..3b727979 100644 --- a/assets/cubyz/shaders/skybox/star.vs +++ b/assets/cubyz/shaders/skybox/star.vs @@ -1,5 +1,9 @@ #version 460 +layout(location = 0) out vec3 pos; +layout(location = 1) out flat vec3 centerPos; +layout(location = 2) out flat vec3 color; + struct star { vec4 vertexPositions[3]; @@ -13,12 +17,8 @@ layout (std430, binding = 12) buffer _starBuffer { star starData[]; }; -uniform mat4 mvp; -uniform float starOpacity; - -layout(location = 0) out vec3 pos; -layout(location = 1) out flat vec3 centerPos; -layout(location = 2) out flat vec3 color; +layout(location = 0) uniform mat4 mvp; +layout(location = 1) uniform float starOpacity; void main() { gl_Position = mvp*vec4(starData[gl_VertexID/3].vertexPositions[gl_VertexID%3].xyz, 1); diff --git a/assets/cubyz/shaders/ui/button.fs b/assets/cubyz/shaders/ui/button.fs index 6787f18c..007fb86f 100644 --- a/assets/cubyz/shaders/ui/button.fs +++ b/assets/cubyz/shaders/ui/button.fs @@ -7,7 +7,7 @@ layout(location = 1) flat in vec4 fColor; layout(binding = 0) uniform sampler2D image; -uniform float scale; +layout(location = 4) uniform float scale; void main() { frag_color = texture(image, (gl_FragCoord.xy - startCoord)/(2*scale)/textureSize(image, 0)); diff --git a/assets/cubyz/shaders/ui/button.vs b/assets/cubyz/shaders/ui/button.vs index 1303c067..28cc3af7 100644 --- a/assets/cubyz/shaders/ui/button.vs +++ b/assets/cubyz/shaders/ui/button.vs @@ -6,11 +6,11 @@ layout(location = 0) out vec2 startCoord; layout(location = 1) flat out vec4 fColor; //in pixel -uniform vec2 start; -uniform vec2 size; -uniform vec2 screen; +layout(location = 0) uniform vec2 start; +layout(location = 1) uniform vec2 size; +layout(location = 2) uniform vec2 screen; -uniform int color; +layout(location = 3) uniform int color; void main() { // Convert to opengl coordinates: diff --git a/assets/cubyz/shaders/ui/window_border.fs b/assets/cubyz/shaders/ui/window_border.fs index 068efac3..9fdc1243 100644 --- a/assets/cubyz/shaders/ui/window_border.fs +++ b/assets/cubyz/shaders/ui/window_border.fs @@ -6,10 +6,11 @@ layout(location = 0) flat in vec2 startCoord; layout(location = 1) flat in vec2 endCoord; layout(location = 2) flat in vec4 fColor; -uniform vec2 start; -uniform vec2 size; -uniform float scale; -uniform vec2 effectLength; +layout(location = 0) uniform vec2 start; +layout(location = 1) uniform vec2 size; + +layout(location = 4) uniform float scale; +layout(location = 5) uniform vec2 effectLength; void main() { vec2 distanceToBorder = min(gl_FragCoord.xy - startCoord, endCoord - gl_FragCoord.xy)/effectLength/scale; diff --git a/assets/cubyz/shaders/ui/window_border.vs b/assets/cubyz/shaders/ui/window_border.vs index 0f019321..a72d3629 100644 --- a/assets/cubyz/shaders/ui/window_border.vs +++ b/assets/cubyz/shaders/ui/window_border.vs @@ -7,11 +7,11 @@ layout(location = 1) flat out vec2 endCoord; layout(location = 2) flat out vec4 fColor; //in pixel -uniform vec2 start; -uniform vec2 size; -uniform vec2 screen; +layout(location = 0) uniform vec2 start; +layout(location = 1) uniform vec2 size; +layout(location = 2) uniform vec2 screen; -uniform int color; +layout(location = 3) uniform int color; void main() { // Convert to opengl coordinates: