#677 Add clipping to trees and alpha masked blinn-phong
parent
5abc68ad43
commit
4e61152ca2
|
|
@ -31,14 +31,20 @@ uniform float minimum_alpha;
|
|||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
in vec3 vary_position;
|
||||
|
||||
in vec3 vary_normal;
|
||||
in vec4 vertex_color;
|
||||
in vec2 vary_texcoord0;
|
||||
|
||||
vec2 encode_normal(vec3 n);
|
||||
|
||||
void mirrorClip(vec3 pos);
|
||||
|
||||
void main()
|
||||
{
|
||||
mirrorClip(vary_position);
|
||||
|
||||
vec4 col = texture(diffuseMap, vary_texcoord0.xy) * vertex_color;
|
||||
|
||||
if (col.a < minimum_alpha)
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
out vec4 frag_data[4];
|
||||
|
||||
in vec3 vary_normal;
|
||||
in vec3 vary_position;
|
||||
|
||||
uniform float minimum_alpha;
|
||||
|
||||
|
|
@ -36,8 +37,12 @@ in vec2 vary_texcoord0;
|
|||
|
||||
vec2 encode_normal(vec3 n);
|
||||
|
||||
void mirrorClip(vec3 pos);
|
||||
|
||||
void main()
|
||||
{
|
||||
mirrorClip(vary_position);
|
||||
|
||||
vec4 col = diffuseLookup(vary_texcoord0.xy) * vertex_color;
|
||||
|
||||
if (col.a < minimum_alpha)
|
||||
|
|
|
|||
|
|
@ -32,13 +32,16 @@ uniform sampler2D diffuseMap;
|
|||
in vec4 vertex_color;
|
||||
in vec3 vary_normal;
|
||||
in vec2 vary_texcoord0;
|
||||
in vec3 vary_position;
|
||||
|
||||
uniform float minimum_alpha;
|
||||
|
||||
vec2 encode_normal(vec3 n);
|
||||
|
||||
void mirrorClip(vec3 pos);
|
||||
void main()
|
||||
{
|
||||
mirrorClip(vary_position);
|
||||
vec4 col = texture(diffuseMap, vary_texcoord0.xy);
|
||||
if (col.a < minimum_alpha)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
*/
|
||||
|
||||
uniform mat4 texture_matrix0;
|
||||
uniform mat4 modelview_matrix;
|
||||
uniform mat4 modelview_projection_matrix;
|
||||
uniform mat3 normal_matrix;
|
||||
|
||||
|
|
@ -34,11 +35,14 @@ in vec2 texcoord0;
|
|||
out vec3 vary_normal;
|
||||
out vec4 vertex_color;
|
||||
out vec2 vary_texcoord0;
|
||||
out vec3 vary_position;
|
||||
|
||||
void main()
|
||||
{
|
||||
//transform vertex
|
||||
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
|
||||
vary_position = (modelview_matrix*vec4(position.xyz, 1.0)).xyz;
|
||||
|
||||
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
|
||||
|
||||
vary_normal = normalize(normal_matrix * normal);
|
||||
|
|
|
|||
|
|
@ -299,6 +299,9 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
|
|||
mShaderList.push_back(&gDeferredPBRAlphaProgram);
|
||||
mShaderList.push_back(&gDeferredAvatarProgram);
|
||||
mShaderList.push_back(&gDeferredTerrainProgram);
|
||||
mShaderList.push_back(&gDeferredDiffuseAlphaMaskProgram);
|
||||
mShaderList.push_back(&gDeferredNonIndexedDiffuseAlphaMaskProgram);
|
||||
mShaderList.push_back(&gDeferredTreeProgram);
|
||||
}
|
||||
|
||||
LLViewerShaderMgr::~LLViewerShaderMgr()
|
||||
|
|
|
|||
Loading…
Reference in New Issue