Quellcode durchsuchen

Update gbuffer.fs for GLES3

pull/4705/head
MikiZX1 vor 2 Monaten
committed von GitHub
Ursprung
Commit
b51a84977f
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden GPG-Schlüssel-ID: B5690EEEBB952194
1 geänderte Dateien mit 19 neuen und 29 gelöschten Zeilen
  1. +19
    -29
      examples/shaders/resources/shaders/glsl100/gbuffer.fs

+ 19
- 29
examples/shaders/resources/shaders/glsl100/gbuffer.fs Datei anzeigen

@ -1,36 +1,26 @@
#version 100
#version 300 es
precision mediump float;
precision highp float;
// Input vertex attributes (from vertex shader)
varying vec3 fragPosition;
varying vec2 fragTexCoord;
varying vec3 fragNormal;
varying vec4 fragColor;
layout (location = 0) out vec4 gPosition;
layout (location = 1) out vec4 gNormal;
layout (location = 2) out vec4 gAlbedoSpec;
// TODO: Is there some alternative for GLSL100
//layout (location = 0) out vec3 gPosition;
//layout (location = 1) out vec3 gNormal;
//layout (location = 2) out vec4 gAlbedoSpec;
//uniform vec3 gPosition;
//uniform vec3 gNormal;
//uniform vec4 gAlbedoSpec;
in vec3 fragPosition;
in vec2 fragTexCoord;
in vec3 fragNormal;
in vec4 fragColor;
// Input uniform values
uniform sampler2D texture0; // Diffuse texture
uniform sampler2D diffuseTexture;
uniform sampler2D specularTexture;
void main()
{
// Store the fragment position vector in the first gbuffer texture
//gPosition = fragPosition;
// Store the per-fragment normals into the gbuffer
//gNormal = normalize(fragNormal);
// Store the diffuse per-fragment color
gl_FragColor.rgb = texture2D(texture0, fragTexCoord).rgb;
// Store specular intensity in gAlbedoSpec's alpha component
gl_FragColor.a = texture2D(specularTexture, fragTexCoord).r;
void main() {
// store the fragment position vector in the first gbuffer texture
gPosition = vec4(fragPosition,1.0);
// also store the per-fragment normals into the gbuffer
gNormal = vec4(normalize(fragNormal),1.0);
// and the diffuse per-fragment color
gAlbedoSpec.rgb = texture(diffuseTexture, fragTexCoord).rgb;
// store specular intensity in gAlbedoSpec's alpha component
gAlbedoSpec.a = texture(specularTexture, fragTexCoord).r;
}

Laden…
Abbrechen
Speichern