Skip to content

Commit

Permalink
Fixed a couple more shader bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
MeltyPlayer committed Dec 21, 2024
1 parent 333ce48 commit 8515e1c
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void main() {
vec4 emissiveColor = texture(emissiveTexture, uv0);
fragColor.rgb += emissiveColor.rgb;
fragColor.rgb = min(fragColor.rgb, 1);
fragColor.rgb = min(fragColor.rgb, 1.0);
if (fragColor.a < .95) {
discard;
Expand Down Expand Up @@ -250,7 +250,7 @@ void main() {
vec4 emissiveColor = texture(emissiveTexture, uv0);
fragColor.rgb += emissiveColor.rgb;
fragColor.rgb = min(fragColor.rgb, 1);
fragColor.rgb = min(fragColor.rgb, 1.0);
if (fragColor.a < .95) {
discard;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,9 @@ var usesSphericalReflectionMapping
}
};

if (dependsOnLights) {
AppendLineBetweenUniformsAndIns();
sb.AppendLine("in vec3 vertexPosition;");
}

if (dependsOnNormals) {
AppendLineBetweenUniformsAndIns();
sb.AppendLine("in vec3 vertexPosition;");
sb.AppendLine("in vec3 vertexNormal;");

if (hasNormalTexture &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public StandardShaderSourceGlsl(
fragmentShaderSrc.AppendLine(
"""
fragColor.rgb += emissiveColor.rgb;
fragColor.rgb = min(fragColor.rgb, 1);
fragColor.rgb = min(fragColor.rgb, 1.0);
""");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ layout (std140, binding = 1) uniform Matrices {

uniform sampler2D texture0;

in vec3 vertexPosition;
in vec3 vertexNormal;

out vec4 fragColor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ layout (std140, binding = 1) uniform Matrices {

uniform sampler2D texture0;

in vec3 vertexPosition;
in vec3 vertexNormal;

out vec4 fragColor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ vec2 transformUv3d(mat4 transform3d, vec2 inUv) {

uniform Texture texture0;

in vec3 vertexPosition;
in vec3 vertexNormal;

out vec4 fragColor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ vec2 transformUv3d(mat4 transform3d, vec2 inUv) {
uniform Texture texture0;
uniform Texture texture1;

in vec3 vertexPosition;
in vec3 vertexNormal;
in vec2 uv0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ vec2 transformUv3d(mat4 transform3d, vec2 inUv) {

uniform Texture texture0;

in vec3 vertexPosition;
in vec3 vertexNormal;
in vec4 vertexColor0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ vec2 transformUv3d(mat4 transform3d, vec2 inUv) {
uniform Texture texture0;
uniform Texture texture1;

in vec3 vertexPosition;
in vec3 vertexNormal;
in vec2 uv0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ vec2 transformUv3d(mat4 transform3d, vec2 inUv) {
uniform Texture texture0;
uniform Texture texture1;

in vec3 vertexPosition;
in vec3 vertexNormal;
in vec2 uv0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ vec2 transformUv3d(mat4 transform3d, vec2 inUv) {
uniform Texture texture0;
uniform Texture texture1;

in vec3 vertexPosition;
in vec3 vertexNormal;
in vec2 uv0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct Texture {
uniform Texture texture0;
uniform Texture texture1;

in vec3 vertexPosition;
in vec3 vertexNormal;
in vec2 uv0;

Expand Down

0 comments on commit 8515e1c

Please sign in to comment.