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 | |
---|
3 | precision mediump int; |
---|
4 | precision mediump float; |
---|
5 | |
---|
6 | uniform vec4 random_fractions; |
---|
7 | uniform vec4 heatBiasScale; |
---|
8 | uniform vec4 depth_modulator; |
---|
9 | |
---|
10 | uniform sampler2D Input; // output of HeatVisionCaster_fp (NdotV) |
---|
11 | uniform sampler2D NoiseMap; |
---|
12 | uniform sampler2D HeatLookup; |
---|
13 | |
---|
14 | varying vec4 diffuse; |
---|
15 | varying vec2 uv; |
---|
16 | |
---|
17 | void 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.