Welcome, Guest.
Username: Password: Remember me

TOPIC: Simple Emboss Shader

Simple Emboss Shader 1 year 4 months ago #1

I'm currently using QeffectsGL for older games such as GZDoom, Half-Life, Doom 3, and etc... and it's emboss effects is a simple way to add some "depth" to those flat 2D textures.

Is it possible to make a ME shader that would duplicate that effect? I found this link that has some shader code but have no idea how to add it to Reshade.

It would be great to add this for old school games.
The administrator has disabled public write access.

Simple Emboss Shader 1 year 4 months ago #2

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 716
If you could share the shader code here I or someone else can have a look.
The administrator has disabled public write access.
The following user(s) said Thank You: Valken

Simple Emboss Shader 1 year 4 months ago #3

  • Ioxa
  • Ioxa's Avatar
  • Offline
  • Posts: 267
  • Thank you received: 245
I can do that with my high pass shader. It's basically the same thing but using only a horizontal or vertical blur instead of both. That picture in the link looks like it uses a diagonal blur. If I have time tonight I'll do a couple of quick tests and see how it looks.
The administrator has disabled public write access.
The following user(s) said Thank You: Valken

Simple Emboss Shader 1 year 4 months ago #4

The link is here with full source code but I am unsure of the format it is in:

gmc.yoyogames.com/index.php?showtopic=586870

QeffectsGL looks like it applies to everything - textures, pixels, voxels, models except for the player model/pixel and hud.

Thanks for looking into this!
The administrator has disabled public write access.

Simple Emboss Shader 1 year 4 months ago #5

  • Ioxa
  • Ioxa's Avatar
  • Offline
  • Posts: 267
  • Thank you received: 245
Did a quick test and came up with this. The size and direction of the offset could easily be adjusted. What kind of settings does the shader you're using have?
The administrator has disabled public write access.

Simple Emboss Shader 1 year 4 months ago #6

Looking great!

The settings available from QeffectsGL are:

Emboss=1
EmbossScale=0.666

Source code for QEffectsGL at the below link if you want to look at it:

code.google.com/p/qeffects-gl/
The administrator has disabled public write access.

Simple Emboss Shader 1 year 4 months ago #7

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 716
There was source code inside the DLL. Works slightly different than the one in this forum (or Ioxa's) so visual result may differ. A bit overkill but maybe a switch from depth difference check to normal difference check like I do for my AO shaders might work even better.

Warning: Spoiler! [ Click to expand ]

Warning: Spoiler! [ Click to expand ]
Last Edit: 1 year 4 months ago by Marty McFly.
The administrator has disabled public write access.

Simple Emboss Shader 1 year 4 months ago #8

Looks really good already! The floor, walls and fence do have more depth. I think at a higher resolution, the details would blend in better.

I think the next step would be to port POM and parallax shaders for better texture map depth in the future for Doom 3 engine games like Sikkmod.

Can't wait to try this for Half-Life, GZdoom and other games.
The administrator has disabled public write access.

Simple Emboss Shader 1 year 4 months ago #9

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 716
Parallax Occlusion mapping is next to impossible with depth and color only. You maybe can generate the needed textures with embossing the current ones; I managed to create some kind of glossy bumpmapping similiar to ENB's one but looked fugly.

Although...I just had a crazy idea I need to try out later...embossing pseudo normal maps out of diffuse textures is simple, actually works similiar to this here. If I use the existing face normals by adding those embossed ones on top of them, I might get some roughness of the surface that I need for such purposes. Maybe not for POM but certainly for some fake lighting. Let me see....
Last Edit: 1 year 4 months ago by Marty McFly.
The administrator has disabled public write access.
The following user(s) said Thank You: BillyAlt

Simple Emboss Shader 1 year 4 months ago #10

Please no "mud" effects unless we can restrict it to liquids only... :D

May be cool in GZdoom or Half-Life or Doom 3/Quake 4 for "sewage" but I think it would need to map it to specific textures.

If you can pull some kind of Environment Mapped Bump Mapping effect, that would be incredible detail wise over simple emboss bump mapping.
The administrator has disabled public write access.

Simple Emboss Shader 1 year 4 months ago #11

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 716
Valken wrote:
If you can pull some kind of Environment Mapped Bump Mapping effect, that would be incredible detail wise over simple emboss bump mapping.

Bump mapping in these areas just simulates light and shade on single pixel scale, nothing global so even if I could take the environment lighting into account, it would be vast calculation at a horrible performance which in effect would look 99% similiar to what we have here so I really doubt this is worth the effort.

EDIT: My assumptions concerning the normals were correct, these are A+ normals for the use in any AO technique or whatever.Notice the fine relief on surfaces that are actually 100% flat.

Last Edit: 1 year 4 months ago by Marty McFly.
The administrator has disabled public write access.
The following user(s) said Thank You: klotim

Simple Emboss Shader 1 year 4 months ago #12

  • klotim
  • klotim's Avatar
  • Offline
  • Posts: 66
  • Thank you received: 21
A Strength variable 1-100 for the blue channel for the normalmaps would be amazing. Because if that channel is too strong, the textures could have ugly black spots.
The administrator has disabled public write access.

Simple Emboss Shader 1 year 4 months ago #13

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 716
Nope, that won't happen because by definition, normal maps cannot exceed their range. I just put them for screenshot purposes into 0-1 range, they are actually in -1 to 1 range. And because they are generated by depth difference, blue channel or better z value is always 1. Oh and I actually managed to prove my own words wrong, environment bumpmapping is indeed possible, I just did it:

Last Edit: 1 year 4 months ago by Marty McFly.
The administrator has disabled public write access.
The following user(s) said Thank You: BillyAlt

Simple Emboss Shader 1 year 4 months ago #14

  • BillyAlt
  • BillyAlt's Avatar
  • Offline
  • Posts: 42
  • Thank you received: 9
Nice.
The administrator has disabled public write access.

Simple Emboss Shader 1 year 4 months ago #15

  • klotim
  • klotim's Avatar
  • Offline
  • Posts: 66
  • Thank you received: 21
Marty McFly wrote:
Nope, that won't happen because by definition, normal maps cannot exceed their range. I just put them for screenshot purposes into 0-1 range, they are actually in -1 to 1 range. And because they are generated by depth difference, blue channel or better z value is always 1. Oh and I actually managed to prove my own words wrong, environment bumpmapping is indeed possible, I just did it:

I quess that can't happen then when coding, I know in photoshop when working with normalmaps, by adding multiple normals on top causes a too strong blue channel causing artifacts. Normalizing and brighten the blue channel a bit fixes that.

Yup, Beautiful, Seen it on facebook. Good job!
Last Edit: 1 year 4 months ago by klotim.
The administrator has disabled public write access.

Simple Emboss Shader 1 year 4 months ago #16

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 716
klotim wrote:
Marty McFly wrote:
Nope, that won't happen because by definition, normal maps cannot exceed their range. I just put them for screenshot purposes into 0-1 range, they are actually in -1 to 1 range. And because they are generated by depth difference, blue channel or better z value is always 1. Oh and I actually managed to prove my own words wrong, environment bumpmapping is indeed possible, I just did it:

I quess that can't happen then when coding, I know in photoshop when working with normalmaps, by adding multiple normals on top causes a too strong blue channel causing artifacts. Normalizing and brighten the blue channel a bit fixes that.

Yup, Beautiful, Seen it on facebook. Good job!

Remember that normals are not colors but vectors. Vectors can have any number of range. For texture lookup I only use X and Y factor of those where ranges don't matter. If I normalized those normal maps after adding the bump normals to the screen normals I couldn't really control the relief amount: normalize(bumpnormal + screen normal) means the higher I scale the bump normals, the less the screen normals are taken into account. Imagine the bump normals being 9x the screen normals, resulting normals would consist of 10% bump normals and 90% screen normals. Impossible. I have to use the screen normals and add the scaled bump normals onto them without any normalization. That essentially is against what "normals" are but I do a physically inaccurate effect so I can ignore that anyways.
Last Edit: 1 year 4 months ago by Marty McFly.
The administrator has disabled public write access.

Simple Emboss Shader 1 year 4 months ago #17

This is amazing guys, one of the first great new ideas that has grabbed my attention again, could be an innovative way of giving old games a new lease of life, i hope an emboss shader can be derived from these demonstrations. ;)
The administrator has disabled public write access.

Simple Emboss Shader 1 year 4 months ago #18

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 716
Aelius Maximus wrote:
This is amazing guys, one of the first great new ideas that has grabbed my attention again, could be an innovative way of giving old games a new lease of life, i hope an emboss shader can be derived from these demonstrations. ;)

I don't quite get what you are saying, as I posted a fully working emboss shader and the reflective bumpmapping is a huge evolution of that. There is nothing left to derive, we even shooted way ahead than planned.
The administrator has disabled public write access.

Simple Emboss Shader 1 year 4 months ago #19

but on what surface to apply reflection ??
the demo pic also shows artifacts on trees and stuffs.
The administrator has disabled public write access.

Simple Emboss Shader 1 year 4 months ago #20

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 716
kingeric1992 wrote:
but on what surface to apply reflection ??
the demo pic also shows artifacts on trees and stuffs.

Artifacts? GTASA trees look so shitty like this. See here:

abload.de/img/gta_sa2015-07-1623-28ynz4v.png

The poor alpha handling of GTASA causes semi-transparent areas make it see-through for textures that are behind.


And it's the curse of ReShade being so generic. And on ENB no one ever complained when it applied almost the same algorithm on everything. Try it out when it's released, good settings and it really fits almost every scene. I just amplified the effect to make it visible, like I do with everything. People keep seeing these debug-ish screens as end product.
Last Edit: 1 year 4 months ago by Marty McFly.
The administrator has disabled public write access.