Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/GLSL150/LightToHeatFp.glsl @ 12181

Last change on this file since 12181 was 12115, checked in by wiesep, 6 years ago

Changed folder structure, deletet some unused files and cleaned up code

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