mirror of
https://github.com/overte-org/overte.git
synced 2025-08-16 17:13:02 +02:00
44 lines
1.1 KiB
Text
Executable file
44 lines
1.1 KiB
Text
Executable file
<@include gpu/Config.slh@>
|
|
<$VERSION_HEADER$>
|
|
// Generated on <$_SCRIBE_DATE$>
|
|
//
|
|
// model_specular_map.frag
|
|
// fragment shader
|
|
//
|
|
// Created by Andrzej Kapolka on 5/6/14.
|
|
// Copyright 2014 High Fidelity, Inc.
|
|
//
|
|
// Distributed under the Apache License, Version 2.0.
|
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
//
|
|
|
|
<@include DeferredBufferWrite.slh@>
|
|
|
|
<@include model/Material.slh@>
|
|
|
|
// the diffuse texture
|
|
uniform sampler2D diffuseMap;
|
|
|
|
// the specular texture
|
|
uniform sampler2D specularMap;
|
|
|
|
in vec4 _position;
|
|
in vec2 _texCoord0;
|
|
in vec3 _normal;
|
|
in vec3 _color;
|
|
|
|
|
|
void main(void) {
|
|
// set the diffuse, normal, specular data
|
|
vec4 diffuse = texture(diffuseMap, _texCoord0);
|
|
vec3 specular = texture(specularMap, _texCoord0).rgb;
|
|
|
|
Material mat = getMaterial();
|
|
|
|
packDeferredFragment(
|
|
normalize(_normal),
|
|
evalOpaqueFinalAlpha(getMaterialOpacity(mat), diffuse.a),
|
|
getMaterialDiffuse(mat) * diffuse.rgb * _color,
|
|
specular, //getMaterialSpecular(mat),
|
|
getMaterialShininess(mat));
|
|
}
|