Jump to content


Photo

Rim Lights?


53 replies to this topic

#26 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1976 posts

Posted 05 December 2018 - 11:14 AM

https://drive.google...iew?usp=sharing

textures/frestest/models/sphere
{
	translucent
	twosided
	nonsolid
	ambientRimColor		0.2, 0, 0.2
	
    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
        }
}

Attached Thumbnails

  • Untitled.jpg


#27 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1842 posts

Posted 05 December 2018 - 11:42 AM

Yup, it works, but as a global keyword it will have limited uses IMO (and I suspect it will be modified by normalmaps and such). Stage keyword or image program will be more versatile.



#28 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1976 posts

Posted 05 December 2018 - 12:53 PM

Doing it as a separate stage will require a custom shader. I'm not opposed to that in principle, as long as few materials are going to use it.

When it becomes widespread, it's better off as a part of the ambient shader.


  • Judith likes this

#29 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1842 posts

Posted 05 December 2018 - 02:18 PM

I think it will have limited uses. It might become widespread in a sense that it could look good e.g. as a part of a frob shader. But that will be displayed on screen only in close proximity of an object, so it shouldn't be too taxing on a system.

 

Right now with standard _d _n _s material, the ambient rim color looks like this:

obraz.png

 

While the expected result would be more like this:

obraz.png


Edited by Judith, 05 December 2018 - 02:32 PM.


#30 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1976 posts

Posted 05 December 2018 - 02:47 PM

I think it will have limited uses. It might become widespread in a sense that it could look good e.g. as a part of a frob shader. But that will be displayed on screen only in close proximity of an object, so it shouldn't be too taxing on a system.
 
Right now with standard _d _n _s material, the ambient rim color looks like this:
obraz.png
 
While the expected result would be more like this:
obraz.png

Let me have that model to test

#31 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1842 posts

Posted 05 December 2018 - 02:50 PM

There you go: https://we.tl/t-5J6FwSainy



#32 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1842 posts

Posted 05 December 2018 - 02:55 PM

For additional reference:

 

 

This is UE4, but this was done the same way in non-PBR UE3 (dx9), so it should be possible.


Edited by Judith, 05 December 2018 - 02:56 PM.


#33 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1976 posts

Posted 10 December 2018 - 06:04 AM

For additional reference:

 

 

This is UE4, but this was done the same way in non-PBR UE3 (dx9), so it should be possible.

I'm curious how this partucular model looks with rim lights on in UE?

 

Can you convert it so that it has smoothed normals? See the attached - each face has a hard fixed normal unlike regular D3/TDM models where vertex normals are averaged for each triangle it forms

Attached Thumbnails

  • Untitled.jpg


#34 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1842 posts

Posted 10 December 2018 - 06:37 AM

You mean that most models have just one smoothing group? :o

 

https://we.tl/t-u9IUMKzft3



#35 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1976 posts

Posted 10 December 2018 - 07:21 AM

You mean that most models have just one smoothing group? :o

 

https://we.tl/t-u9IUMKzft3

Not sure what is the correct term for that

But this version is not fully it - see the attached and compare to the top side of the drawer desk

Most of the faces still have hard normals

Attached Thumbnails

  • Untitled.jpg


#36 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1842 posts

Posted 10 December 2018 - 07:30 AM

Yeah, the drawer has one smoothing group for the whole piece. I didn't save the source file for the cube, I'll have to make it from scratch. There's something seriously wrong with DR exporting .ase models. It often exports triangles 2-3 times, so they all overlap and have z-fighting.


  • duzenko likes this

#37 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1976 posts

Posted 10 December 2018 - 08:56 AM

Yeah, the drawer has one smoothing group for the whole piece. I didn't save the source file for the cube, I'll have to make it from scratch. There's something seriously wrong with DR exporting .ase models. It often exports triangles 2-3 times, so they all overlap and have z-fighting.

I would really like to see the end result of that model in UE if possible

I'm afraid the basic rim lights can't do that exact contour thing from your screenshot



#38 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1842 posts

Posted 10 December 2018 - 09:10 AM

I don't have UE4 installed ATM, but I will export that model in the evening. Or, maybe something more practical will be better, like a usable item or lever?



#39 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1976 posts

Posted 10 December 2018 - 09:25 AM

I don't have UE4 installed ATM, but I will export that model in the evening. Or, maybe something more practical will be better, like a usable item or lever?

Whatever model makes sense from the mapper/gameplay point of view



#40 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1842 posts

Posted 12 December 2018 - 04:33 PM

Sorry that it took me so long, but I wanted to have a fully unwrapped switch to see how the rim light utilises 0-1 uv space.

 

obraz.png

 

Right now it works quite nicely, although it is affected by the normalmap. That's why I opted for image program rather than global keyword, so we could e.g. overlay it on top.


  • VanishedOne likes this

#41 STiFU

STiFU

    Uber member

  • Development Role
  • PipPipPipPip
  • 3511 posts

Posted 12 December 2018 - 04:48 PM

That could be a neat frob highlight... :)

#42 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1842 posts

Posted 13 December 2018 - 03:31 AM

Yup, that could be one of its uses. Some more degree of control over the effect and we're good :)



#43 STiFU

STiFU

    Uber member

  • Development Role
  • PipPipPipPip
  • 3511 posts

Posted 13 December 2018 - 05:21 AM

I am interested in changing the look of the frob highlight because in certain lighting situations I just can't tell whether an object is highlighted or not. So I had a quick look at the code yesterday, to see how extensive a code change for frob highlight would be. Apparently, it is pretty much all defined in the mtr files, which means there is no flexibility in the current implementation. I guess this subpar solution came to fruition due to the fact the SDK was not open-source yet. So, changing the frob highlight code would require quite some refactoring which I should better leave to people more experienced with TDM's codebase.  :-(



#44 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1976 posts

Posted 13 December 2018 - 05:39 AM

I wonder how that model looks with UE rim light

 

 

Right now it works quite nicely, although it is affected by the normalmap. That's why I opted for image program rather than global keyword, so we could e.g. overlay it on top.

I think the engine should already support it via a custom material shader



#45 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1842 posts

Posted 13 December 2018 - 08:14 AM

 

I wonder how that model looks with UE rim light

 

Actually, it looks the same, so the math is correct (if you were worried about that):

 

obraz.png

obraz.png

 

Edit: okay, so this works as it should. I mean, having a thin outline like in this Dishonored shot is impossible to have with fresnel function. Creating object outline is pretty complex thing, actually:

 

http://www.michalorz...around-objects/

 


Edited by Judith, 13 December 2018 - 08:28 AM.


#46 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1976 posts

Posted 13 December 2018 - 08:53 AM

Are we good for now or there's more finetuning to do? (Short of the outline thing)



#47 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1842 posts

Posted 13 December 2018 - 09:02 AM

No, this is exactly how it should work :) Outlining is whole other thing (I thought it wasn't, sorry).


  • duzenko likes this

#48 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1842 posts

Posted 13 December 2018 - 11:22 AM

So I had a quick look at the code yesterday, to see how extensive a code change for frob highlight would be. Apparently, it is pretty much all defined in the mtr files, which means there is no flexibility in the current implementation.

 

IMO per-material approach is the most flexible, as you can fine-tune the frob intensity in relation to a model, and even to its particular instance in the world (with shaderparm). Problems start when you want to make quick global changes for all materials.



#49 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 903 posts

Posted 13 December 2018 - 11:31 AM

 

IMO per-material approach is the most flexible, as you can fine-tune the frob intensity in relation to a model, and even to its particular instance in the world (with shaderparm). Problems start when you want to make quick global changes for all materials.

Agreed. It's a shame the available version of id Tech 4 doesn't have a template system for material defs like Q4's or ET:QW's, which could have reduced the amount of text needed.


Some things I'm repeatedly thinking about...

- louder scream when you're dying


#50 STiFU

STiFU

    Uber member

  • Development Role
  • PipPipPipPip
  • 3511 posts

Posted 13 December 2018 - 06:18 PM

Problems start when you want to make quick global changes for all materials.


That's exactly what I was aiming at. I would like the player to be able to configure the frob highlight to his desires. :-)
  • Judith likes this



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users