Shader Help Thread

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Posts: 518
Joined: Sat Sep 23, 2017 8:42 am
Graphics Processor: nVidia with Vulkan support

Re: Shader Help Thread

Post by Darkcrafter »

I would like to make at least a semidecent fake environment map based shader. I already got one working in GZDoom but I'd like to mix that shader result to a texture applied so the effect of "reflection" would have an effect amount (opacity).

Here is the shader by Marisa:

Code: Select all

vec4 Process(vec4 color)
    vec3 eyedir = normalize( -;
    vec3 norm = reflect(eyedir, normalize(;
    return getTexel(norm.xz * 0.5) * color ;
It basicaly takes a texture (environment map) and applies it over a surface so it renders in a sky manner.
Here is what it looks like:
The shader.jpg
Here is what I'd like to get (I put a thin opaque 3D floor above the surface with the shader texture applied):
Desired result.jpg
Here is the enivornment map texture:
So what I'd like to get is to being able to define a particular environment map texture in GLDEFS per texture so the shader would kind of process both textures at once, like that:

Code: Select all

material texture "FLOOR7_2"
	shader "shaders/EnvMapRefl_Marisa.fp"
        reflectionmap "textures/reflectionmaps/environmentmap1.jpg"
        opacity 0.5
You do not have the required permissions to view the files attached to this post.

Return to “Assets (and other stuff)”