Skip to content

Commit

Permalink
Fixed some line break issues in the generated GLSL.
Browse files Browse the repository at this point in the history
  • Loading branch information
MeltyPlayer committed Nov 28, 2024
1 parent 7a9e7b9 commit adc72c4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,12 @@ public StandardShaderSourceGlsl(
out vec4 fragColor;

in vec4 vertexColor0;

""");

if (hasNormals) {
fragmentShaderSrc.Append(
"""

in vec3 vertexPosition;
in vec3 vertexNormal;
in vec3 tangent;
Expand All @@ -109,13 +108,13 @@ public StandardShaderSourceGlsl(
{GlslUtil.GetGetMergedLightColorsFunction()}

{GlslUtil.GetApplyMergedLightColorsFunction(true)}

""");
}

fragmentShaderSrc.Append(
$$"""


void main() {
vec4 diffuseColor = {{GlslUtil.ReadColorFromTexture("diffuseTexture", $"uv{diffuseTexture?.UvIndex ?? 0}", diffuseTexture, animations)}};
vec4 ambientOcclusionColor = {{GlslUtil.ReadColorFromTexture("ambientOcclusionTexture", $"uv{ambientOcclusionTexture?.UvIndex ?? 0}", ambientOcclusionTexture, animations)}};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ in vec4 vertexColor0;
in vec3 vertexPosition;
in vec3 vertexNormal;
in vec3 tangent;
in vec3 binormal;in vec2 uv0;
in vec3 binormal;
in vec2 uv0;

void getSurfaceToLightNormalAndAttenuation(Light light, vec3 position, vec3 normal, out vec3 surfaceToLightNormal, out float attenuation) {
vec3 surfaceToLight = light.position - position;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ in vec4 vertexColor0;
in vec3 vertexPosition;
in vec3 vertexNormal;
in vec3 tangent;
in vec3 binormal;in vec2 uv0;
in vec3 binormal;
in vec2 uv0;

void getSurfaceToLightNormalAndAttenuation(Light light, vec3 position, vec3 normal, out vec3 surfaceToLightNormal, out float attenuation) {
vec3 surfaceToLight = light.position - position;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ in vec4 vertexColor0;
in vec3 vertexPosition;
in vec3 vertexNormal;
in vec3 tangent;
in vec3 binormal;in vec2 uv0;
in vec3 binormal;
in vec2 uv0;

void getSurfaceToLightNormalAndAttenuation(Light light, vec3 position, vec3 normal, out vec3 surfaceToLightNormal, out float attenuation) {
vec3 surfaceToLight = light.position - position;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ in vec4 vertexColor0;
in vec3 vertexPosition;
in vec3 vertexNormal;
in vec3 tangent;
in vec3 binormal;in vec2 uv0;
in vec3 binormal;
in vec2 uv0;

void getSurfaceToLightNormalAndAttenuation(Light light, vec3 position, vec3 normal, out vec3 surfaceToLightNormal, out float attenuation) {
vec3 surfaceToLight = light.position - position;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ in vec4 vertexColor0;
in vec3 vertexPosition;
in vec3 vertexNormal;
in vec3 tangent;
in vec3 binormal;in vec2 uv0;
in vec3 binormal;
in vec2 uv0;

void getSurfaceToLightNormalAndAttenuation(Light light, vec3 position, vec3 normal, out vec3 surfaceToLightNormal, out float attenuation) {
vec3 surfaceToLight = light.position - position;
Expand Down

0 comments on commit adc72c4

Please sign in to comment.