Просмотр исходного кода

Update gbuffer.fs for GLES3

pull/4706/head
MikiZX1 1 год назад
committed by GitHub
Родитель
Сommit
8e7e9feb64
Не найден GPG ключ соответствующий данной подписи Идентификатор GPG ключа: B5690EEEBB952194
1 измененных файлов: 6 добавлений и 4 удалений
  1. +6
    -4
      examples/shaders/resources/shaders/glsl100/gbuffer.fs

+ 6
- 4
examples/shaders/resources/shaders/glsl100/gbuffer.fs Просмотреть файл

@ -11,8 +11,10 @@ in vec2 fragTexCoord;
in vec3 fragNormal;
in vec4 fragColor;
uniform sampler2D diffuseTexture;
uniform sampler2D specularTexture;
uniform vec4 colDiffuse;
uniform sampler2D texture0;
uniform sampler2D texture1;
void main() {
// store the fragment position vector in the first gbuffer texture
@ -20,7 +22,7 @@ void main() {
// 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;
gAlbedoSpec.rgb = texture(texture0, fragTexCoord).rgb * colDiffuse.rgb;
// store specular intensity in gAlbedoSpec's alpha component
gAlbedoSpec.a = texture(specularTexture, fragTexCoord).r;
gAlbedoSpec.a = pow(texture(texture1, fragTexCoord).r*1.6,16.0);
}

Загрузка…
Отмена
Сохранить