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

Rim Lights?

Recommended Posts

https://drive.google.com/file/d/0B9OoHSmkeSeNZWdyZFliQkNsVTA/view?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
        }
}

post-3508-0-94703100-1544026477_thumb.jpg

Share this post


Link to post
Share on other sites

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.

  • Like 1

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

post-3508-0-05414300-1544439855_thumb.jpg

Share this post


Link to post
Share on other sites

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

post-3508-0-34891900-1544444463_thumb.jpg

Share this post


Link to post
Share on other sites

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.

  • Like 1

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

  • Like 2

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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. :-(

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

 

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.michalorzelek.com/blog/tutorial-creating-outline-effect-around-objects/

 

Edited by Judith

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

 

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

Share this post


Link to post
Share on other sites

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

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

Sign in to follow this  

×
×
  • Create New...