Is it possible to create a shader that makes surfaces look shiny? I guess full reflectiveness probably can't be done but what about something that gives the impression of being shiny? I think it might be quite nice to apply to SHAWN surfaces or maybe windows or something.
I had a play around with the shader used on the glass in Freaky Panties but it makes surfaces look darker and, also, it sort of warps the appearance of the texture; so if you have a regular pattern (e.g. a texture that looks like glass reinforced by a wire mesh) the warping looks wrong.
Shiny Shader Possible?
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.
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.
- Pixel Eater
-
- Posts: 667
- Joined: Wed Aug 02, 2017 12:31 am
- Location: In between the Moon and you, between the buried and me.
Re: Shiny Shader Possible?
Could it be done with the new normal map stuff?
Barring that, I could imagine a shader that makes the texture whiter the more 'head on' you're looking at it...
Barring that, I could imagine a shader that makes the texture whiter the more 'head on' you're looking at it...
Re: Shiny Shader Possible?
New normal map stuff? Dayum, I'm out of the loop. Anywhere to get a good source of info on this? Searches of the Wiki and on here have failed me.
Re: Shiny Shader Possible?
No, because PBR / "Normal stuff" is missing environment maps. I've requested this feature recently viewtopic.php?f=15&t=61269Pixel Eater wrote:Could it be done with the new normal map stuff?
With current pbr, you will only get somekind of "shiny fx" only directly near dynamic light.(and that depends on the pbr material)
Enjay probably wants to achieve this with shaders
However, I'm not sure if this can be achieved with hardware shaders in GZD
Anyways, here are some glsl (vertex and fragment) hardware shader examples of specular reflections
https://stackoverflow.com/questions/117 ... ed-surface
Re: Shiny Shader Possible?
With GZDoom's current material system, what Enjay wants would probably have to rely on there actually being attenuated lights placed in the map, as otherwise materials don't have any lighting to react to.
Makes me wonder how do early 2000s games do those faked environment map reflections? I'm thinking Unreal, Half-Life 1 etc.
Makes me wonder how do early 2000s games do those faked environment map reflections? I'm thinking Unreal, Half-Life 1 etc.
Re: Shiny Shader Possible?
Marisa managed to create half-life-ish fake envmap hardware shader for her UT mod, (check powerup items)
viewtopic.php?f=43&t=60759
viewtopic.php?f=43&t=60759
Re: Shiny Shader Possible?
For those who don't want to download an entire mod just for this bit of code (actually found the same shader MK posted on Discord)
And a variation by Striker:
Code: Select all
vec4 Process(vec4 color)
{
vec3 eyedir = normalize(uCameraPos.xyz - pixelpos.xyz);
vec3 norm = reflect(eyedir, normalize(vWorldNormal.xyz));
return getTexel(norm.xz * 0.5) * color;
}
Code: Select all
vec4 Process(vec4 color)
{
vec3 eyedir = normalize(uCameraPos.xyz - pixelpos.xyz);
vec3 x = dFdx(pixelpos.xyz);
vec3 y = dFdy(pixelpos.xyz);
vec3 normal = normalize(cross(x, y));
vec3 norm = reflect(eyedir, normalize(normal.xyz));
return getTexel(norm.xz * 0.5) * color;
}