Jump to content
The Dark Mod Forums
Sign in to follow this  
duzenko

Rim Lights?

Recommended Posts

Judith actually hacked together a kind of rim light consisting of a radial gradient texture on a cubemap (IIRC), I'm sure he can re-post his steps here.

 

In general I've always found the Deadly Shadows rim light frob highlighting a bit better, but even if you undertook the task of find & replacing all the old frob highlight code in the materials, I can't think of anything else that would benefit from something like that ATM.

Share this post


Link to post
Share on other sites

Is it something we want to add to the engine?

https://www.epicgames.com/unrealtournament/forums/filedata/fetch?id=343728

If so, does it need to be per material or per entity?

 

Hell yes! Some kind of fresnel function would be great to have, I wanted to do a frobbing shader that would look like that, but it could have other uses too. This should be defined by material IMO.

Edited by Judith

Share this post


Link to post
Share on other sites

I'll double check when I get home.

 

Here is a screen from 1.03:

 

penitence01.jpg

 

The highlighting on the normal map on the left wall is influenced by rim lighting.

 

Whether we do too much or not enough is an open question.

 

As well as whether we should give more control of this aspect to mappers.

Share this post


Link to post
Share on other sites

OK I tested tonight:

 

post-3763-0-92084500-1538359939_thumb.jpg

 

Left Image = 2.06 GLSL Default Interaction Shader (No Rim lighting)

 

Middle Image = 2.06 GLSL Enhanced Interaction (Rim lighting on the barrel closest to candle)

 

Right Image = 2.04 ARB Enhanced Interaction shader (Rim lighting on the barrel closest to the candle)

Share this post


Link to post
Share on other sites

Now, whether we also want something extreme like the first (top post) screenshot is another question.

 

Judith made a custom cubemap material for frob that matches that look:

 

http://forums.thedarkmod.com/topic/18990-custom-frob-idea/

 

Do we really need a custom GLSL program to do this when we can do it already (albeit less efficiently)?

Share this post


Link to post
Share on other sites

 

Do we really need a custom GLSL program to do this when we can do it already (albeit less efficiently)?

 

Yes, to control it in more meaningful manner and without using lights.

The shader I made often goes through the whole model:

obraz.png

 

While Duzenko is talking about something like this:

https://api.unrealengine.com/udk/Three/MaterialsCompendium.html#DotProduct

https://api.unrealengine.com/udk/Three/MaterialsCompendium.html#Fresnel

 

And that can be used for things like frob outline, force fields, but also for stuff like metals or transparent glass.

Edited by Judith

Share this post


Link to post
Share on other sites

This is something we could achieve with dot product/fresnel, a more elegant frob:

 

obraz.png

  • Like 2

Share this post


Link to post
Share on other sites

Rim lighting is not only good to make a better frob highlighting like Judith showed but can also give characters well more character, by making them stand out from the background, Valve for example used it for good effect on all their games since HL2.

 

https://www.gamasutra.com/blogs/DavidRosen/20091103/85835/Character_Rim_Lighting.php

 

 

Share this post


Link to post
Share on other sites

Can we sort out the terms here.

I was talking about the ambient silhouette highlighting from all sides, not that "specular" stuff from the point light direction.

Share this post


Link to post
Share on other sites

Rim lighting is not only good to make a better frob highlighting like Judith showed but can also give characters well more character, by making them stand out from the background, Valve for example used it for good effect on all their games since HL2.

 

https://www.gamasutr...im_Lighting.php

 

Yup, rim shaders are often used to separate characters from the environment a bit, or to differentiate friend/foe teams in coop games.

 

I was talking about the ambient silhouette highlighting from all sides, not that "specular" stuff from the point light direction.

 

That's how I understood it, fresnel effect from in engine lighting is a different thing.

Edited by Judith

Share this post


Link to post
Share on other sites

Can we sort out the terms here.

I was talking about the ambient silhouette highlighting from all sides, not that "specular" stuff from the point light direction.

 

That is also rim lighting, it is a term for a particular effect "Rim lighting is a light that typically comes from beside or behind your subject", Valve just used specular to do it in that case. Search for rim lighting on google you will see the picture bellow.

 

rim-lighting-02.jpg?resize=500%2C750&ssl

Share this post


Link to post
Share on other sites

@Duzenko, do you plan on working on this? IMO that would be pretty useful shader to have.

Share this post


Link to post
Share on other sites

@Duzenko, do you plan on working on this? IMO that would be pretty useful shader to have.

Yes, I just need to be poked every so often so I remember that it's something useful for mappers/players

 

What's the consensus on controlling this effect? Material flag / entity spawn arg / etc?

  • Like 1

Share this post


Link to post
Share on other sites

Material flag seems right. The input will be a color or a texture (normalmap?), and the fresnel effect would need some kind of exponent value. Something similar to this: https://api.unrealengine.com/udk/Three/MaterialsCompendium.html#Fresnel

Edited by Judith

Share this post


Link to post
Share on other sites

Um, no, model / geometry materials.

Edited by Judith

Share this post


Link to post
Share on other sites

Um, no, model / geometry materials.

Right

 

But the this rim highlight should only appear as a component of ambient light interactions, no?

 

Because we already have some fresnel in the point light interactions.

Share this post


Link to post
Share on other sites

Yeah, it will be a fake rim light, independent of a light source. Probably the most common use will be the blend add mode.

Share this post


Link to post
Share on other sites

Yeah, it will be a fake rim light, independent of a light source. Probably the most common use will be the blend add mode.

Independent of light source meaning a separate material stage resulting in one more draw call and needing a new GLSL shader?

Or rather a parameter for the ambient light interaction that adds brightness on visible rims when doing our existing ambient light interactions?

Share this post


Link to post
Share on other sites

I think that separate material stage will be more versatile, as you can use different blend modes, textures, and such.

Share this post


Link to post
Share on other sites

I think that separate material stage will be more versatile, as you can use different blend modes, textures, and such.

In that case we might as well use the new custom material shader I've added recently

Do you have a test map for this?

Share this post


Link to post
Share on other sites

Here it goes: https://we.tl/t-XIAHMSqMhI

 

Let's start with a test sphere that is translucent white and two sided, and try to make it look like this (ignore the stuff on the right side):

DotProductExample.jpg

 

 

Basic material for the sphere is:

textures/frestest/models/sphere
{
	translucent
	twosided
	nonsolid
	
    qer_editorimage		textures/frestest/models/sphere_d
    diffusemap       	textures/frestest/models/sphere_d
	
        // TDM Ambient Method Related
        {
                if (global5 == 1)
                blend add
                map                   textures/frestest/models/sphere_d
                scale                  1, 1
                red                     global2
                green                  global3
                blue                    global4
        }
}
Edited by Judith

Share this post


Link to post
Share on other sites
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...