Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #version 100
- precision mediump float;
- varying float lightDiffuse;
- void main()
- {
- float light = ( 1.0 - lightDiffuse) * 0.5;
- vec3 lightColor = vec3(0.0,1.0,1.0);
- vec3 diffuseColor = lightColor * light ;
- vec4 c;
- if(lightDiffuse <0.0 )
- {
- // back faces, opaque
- // front faces, very transparent
- c = vec4(diffuseColor, 0.2);
- }
- else
- {
- discard;
- }
- gl_FragColor = c;
- }
- #version 100
- #define lowp
- #define mediump
- #define highp
- attribute vec4 vertex;
- attribute vec3 normal;
- uniform mat4 normalMatrix;
- uniform mat4 modelViewProjectionMatrix;
- uniform mat4 modelView;
- uniform vec3 camera_world_position;
- varying highp float lightDiffuse;
- void main()
- {
- gl_Position = modelViewProjectionMatrix * vertex;
- vec3 norm = normal;
- norm *=-1.0;
- lightDiffuse = dot(normalize(vec3(norm.x, norm.y, norm.z)), normalize(camera_world_position));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement