Moderators: GZDoom Developers, Raze Developers
Paynamia wrote:Is it at all possible to apply shaders to models at this point? I know it can be managed in Zandronum (and I think older versions of GZDoom) by placing a texture in the textures folder, but it doesn't seem to work in the current version of GZD.
vec4 ProcessTexel()
{
vec3 eyedir = normalize(uCameraPos.xyz-pixelpos.xyz);
vec3 reflected = reflect(eyedir.xyz,normalize(vWorldNormal.xyz));
float m = 2.8284271247461903 * sqrt(reflected.z+ 1.0);
return getTexel(reflected.xy / m + 0.5);
}
void main()
{
vec2 texCoord = vTexCoord.st;
const float pi = 3.14159265358979323846;
vec2 offset = vec2(0,0);
offset.y = sin(pi * 2.0 * (texCoord.x + timer * 0.125)) * 0.1;
offset.x = sin(pi * 2.0 * (texCoord.y + timer * 0.125)) * 0.1;
texCoord += offset;
FragColor = vec4(texCoord.rgba);
}
uniform float timer;
void main()
{
vec2 texCoord = TexCoord.st;
const float pi = 3.14159265358979323846;
vec2 offset = vec2(0,0);
offset.y = sin(pi * 2.0 * (texCoord.x + timer * 0.125)) * 0.1;
offset.x = sin(pi * 2.0 * (texCoord.y + timer * 0.125)) * 0.1;
texCoord += offset;
FragColor = texture(InputTexture, texCoord);
}
HardwareShader PostProcess scene
{
Name "Shader Name"
Shader "Shader Filename.fp" 330
Uniform float timer
Enabled
}
class "ShaderHandler" : EventHandler
{
override void RenderOverlay( RenderEvent e )
{
Shader.SetUniform1f( players[consoleplayer], "Shader Name", "timer", gametic + e.FracTic );
}
}
Return to Assets (and other stuff)
Users browsing this forum: No registered users and 0 guests