Jump to content


Photo

Rim Lights?


38 replies to this topic

#1 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1805 posts

Posted 30 September 2018 - 02:15 PM

Is it something we want to add to the engine?

https://www.epicgame...fetch?id=343728

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


  • Judith, HMart, Epifire and 1 other like this

#2 Spooks

Spooks

    Advanced Member

  • Member
  • PipPipPip
  • 508 posts

Posted 30 September 2018 - 02:27 PM

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.


My FMs: The King of Diamonds (2016)

 

Visit my Mapbook thread sometimes!


#3 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1724 posts

Posted 30 September 2018 - 03:05 PM

Is it something we want to add to the engine?

https://www.epicgame...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, 30 September 2018 - 03:06 PM.


#4 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9101 posts

Posted 30 September 2018 - 03:17 PM

???

 

The HDR light post process includes rim lighting:

 

http://forums.thedar...implementation/

 

Did that get removed?


Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#5 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1805 posts

Posted 30 September 2018 - 03:43 PM

???

 

The HDR light post process includes rim lighting:

 

http://forums.thedar...implementation/

 

Did that get removed?

I never noticed it. Can you see that with ARB shaders? GLSL?



#6 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9101 posts

Posted 30 September 2018 - 04:12 PM

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.


Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#7 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9101 posts

Posted 30 September 2018 - 09:15 PM

OK I tested tonight:

 

Rim_lighting_206.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)


Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#8 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9101 posts

Posted 30 September 2018 - 09:23 PM

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.thedar...stom-frob-idea/

 

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


Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#9 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1724 posts

Posted 01 October 2018 - 12:54 AM

 

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.unrealen...html#DotProduct

https://api.unrealen...um.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, 01 October 2018 - 12:59 AM.


#10 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1724 posts

Posted 01 October 2018 - 02:57 AM

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

 

obraz.png


  • STiFU and HMart like this

#11 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 747 posts

Posted 01 October 2018 - 09:36 AM

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

 

 



#12 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1805 posts

Posted 01 October 2018 - 10:13 AM

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.



#13 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1724 posts

Posted 01 October 2018 - 10:13 AM

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, 01 October 2018 - 10:15 AM.


#14 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 747 posts

Posted 01 October 2018 - 01:34 PM

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



#15 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1724 posts

Posted 04 December 2018 - 05:36 AM

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



#16 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1805 posts

Posted 04 December 2018 - 05:53 AM

@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?


  • Judith likes this

#17 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1724 posts

Posted 04 December 2018 - 06:08 AM

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.unrealen...um.html#Fresnel


Edited by Judith, 04 December 2018 - 06:09 AM.


#18 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1805 posts

Posted 04 December 2018 - 08:49 AM

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.unrealen...um.html#Fresnel

We're talking ambient lights here, right?



#19 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1724 posts

Posted 04 December 2018 - 08:51 AM

Um, no, model / geometry materials.


Edited by Judith, 04 December 2018 - 08:52 AM.


#20 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1805 posts

Posted 04 December 2018 - 09:00 AM

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.



#21 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1724 posts

Posted 04 December 2018 - 09:03 AM

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



#22 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1805 posts

Posted 04 December 2018 - 09:05 AM

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?



#23 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1724 posts

Posted 04 December 2018 - 09:09 AM

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



#24 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1805 posts

Posted 04 December 2018 - 11:19 AM

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?



#25 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1724 posts

Posted 04 December 2018 - 01:26 PM

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, 04 December 2018 - 01:29 PM.




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users