Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSLES/LightToHeatFp.glsles @ 12091

Last change on this file since 12091 was 12091, checked in by wiesep, 5 years ago

Updated programs and adjusted Material to work with GLSL>150

File size: 891 bytes
Line 
1#version 100
2
3precision mediump int;
4precision mediump float;
5
6uniform vec4 random_fractions;
7uniform vec4 heatBiasScale;
8uniform vec4 depth_modulator;
9
10uniform sampler2D Input;         // output of HeatVisionCaster_fp (NdotV)
11uniform sampler2D NoiseMap;
12uniform sampler2D HeatLookup;
13
14varying vec4 diffuse;
15varying vec2 uv;
16
17void main()
18{
19   float  depth, heat, interference;
20
21   //  Output constant color:
22   depth = texture2D( Input, uv ).x;
23   depth *= (depth * depth_modulator).x;
24
25   heat  = (depth * heatBiasScale.y);
26
27//   if (depth > 0)
28   {
29                interference = -0.5 + texture2D( NoiseMap, uv + vec2( random_fractions.x, random_fractions.y ) ).x;
30                interference *= interference;
31                interference *= 1.0 - heat;
32                heat += interference;//+ heatBiasScale.x;
33   }
34
35   // Clamp UVs
36   heat  = max( 0.005, min( 0.995, heat ) );
37   gl_FragColor = texture2D( HeatLookup, vec2( heat, 0.0 ) );
38}
39
Note: See TracBrowser for help on using the repository browser.