Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [f=-000001] Synced LuaRules: finished loading
- [f=-000001] Unsynced LuaRules: starting loading
- [f=-000001] Error: gl.BeginEnd: error(2) = [string "LuaRules/Gadgets/precipitation.lua"]:235: bad argument #2 to 'math_random' ([spring_lua_unsynced_rand(lower, upper)] empty interval)
- [f=-000001] Error: gl.CreateList: error(2) = [string "LuaRules/Gadgets/precipitation.lua"]:235: bad argument #2 to 'math_random' ([spring_lua_unsynced_rand(lower, upper)] empty interval)
- [f=-000001] Error: gl.BeginEnd: error(2) = [string "LuaRules/Gadgets/precipitation.lua"]:251: bad argument #2 to 'math_random' ([spring_lua_unsynced_rand(lower, upper)] empty interval)
- [f=-000001] Error: gl.CreateList: error(2) = [string "LuaRules/Gadgets/precipitation.lua"]:251: bad argument #2 to 'math_random' ([spring_lua_unsynced_rand(lower, upper)] empty interval)
- [f=-000001] Error: gl.BeginEnd: error(2) = [string "LuaRules/Gadgets/precipitation.lua"]:267: bad argument #2 to 'math_random' ([spring_lua_unsynced_rand(lower, upper)] empty interval)
- [f=-000001] Error: gl.CreateList: error(2) = [string "LuaRules/Gadgets/precipitation.lua"]:267: bad argument #2 to 'math_random' ([spring_lua_unsynced_rand(lower, upper)] empty interval)
- >> dualfog vertex shader
- >> varying vec3 eyeDir;
- void main(void)
- {
- gl_TexCoord[0] = gl_MultiTexCoord0;
- eyeDir = gl_MultiTexCoord1.xyz;
- gl_Position = ftransform();
- }
- >> dualfog fragment shader:
- >> const float fogAtten = 0.005;float fogHeight = 400;const vec3 fogColor = vec3(0.80000001,0.85000002,0.94999999); uniform sampler2D tex0;
- uniform float wp11;
- uniform float wp15;
- uniform vec3 eyePos;
- varying vec3 eyeDir;
- void main(void)
- {
- vec2 txcd = vec2(gl_TexCoord[0]);
- float z = texture2D(tex0, txcd).x;
- float d = wp15 / (((z * 2.0) - 1.0) + wp11);
- vec3 toPoint = (d * eyeDir);
- vec3 worldPos = eyePos + toPoint;
- #ifdef DEBUG_GFX // world position debugging
- const float k = 100.0;
- vec3 debugColor = pow(2.0 * abs(0.5 - fract(worldPos / k)), 6.0);
- gl_FragColor = vec4(debugColor, 1.0);
- return; // BAIL
- #endif
- // fogHeight= 255*(time()%5);
- float h0 = clamp(worldPos.y, 0.0, fogHeight);
- float h1 = clamp(eyePos.y, 0.0, fogHeight); // FIXME: uniform ...
- float attenFactor = 1.0 - (0.5 * (h0 + h1) / fogHeight);
- float len = length(toPoint);
- float dist = len * abs((h1 - h0) / toPoint.y); // div-by-zero prob?
- float atten = clamp(1.0 - exp(-dist * attenFactor * fogAtten), 0.0, 1.0);
- gl_FragColor = vec4(fogColor, atten);
- return;
- }
- >> Loaded gadget: Engine Taskbar Stuff <engine_taskbar_stuff.lua>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement