Jump to content
The Dark Mod Forums

Tweaks to Frob highlight


New Horizon

Recommended Posts

@Arcturus: Thats the same problem. Neither normals nor specular are used by the highlight.

 

@Ihstvan: The shader could read the pixel values already rendered and only apply if they are under a certain threshold (as a first idea).

But I think the object has to be rendered twice for that as a surface with a post processing pass is not lit by light sources. How did rebb do his fresnel highlight?

Link to comment
Share on other sites

@Baal ( re: your PM question ) :

 

The fresnel effect is drawn on top of the previous stages in the material, which includes the lit object.

 

And you can pass "_currentRender" whenever you want, the Doom3 Engine will then sort a stage that relies on it ( afaik ) to be drawn after everything else is done drawing.

 

It's true that postProcessing shaders have no access to lighting information in the scene.

Link to comment
Share on other sites

Ok, thank you. Then it's not as restrictive as I thought.

 

So, what does everybody think about a new frob highlight? I think it would be very useful.

In case it's not clear what I propose: I want the highlight to actually light a surface through a shader that uses normals and specular. The difficult part would be to only let it effect dark surfaces and just highlight already lit ones.

Link to comment
Share on other sites

I have no problems with the concept, if I understand you correctly. Right now the froblight only affects the diffusemap, and you want to make it affect the normalmap and specular as well? I'd certainly be interested in seeing what that looks like.

Link to comment
Share on other sites

I'd need to see the before frob/after frob comparison to get a good sense of what it is doing.

Link to comment
Share on other sites

The screenshot above shows the current highlight (right) and my highlight test (left) of an item that is almost black unfrobbed.

But I have to do some work on that and test all the possible lighting situations before I can show something real.

Link to comment
Share on other sites

  • 1 month later...

I didn't get to this for a while now and I don't know how to do the specular lighting of the highlighted object yet. I'm not sure if it's possible through custom shaders but maybe the doom renderer can be used.

Is it possible to create a light that affects only the frobbed object? If somebody who knows the SDK could point me in the right direction that would be helpful.

Link to comment
Share on other sites

Thank you, I have to look into that.

 

I don't have that much time to search through the SDK so could somebody give me a hint where to look for things concerning the interface to the renderer and maybe gamecode using it?

Link to comment
Share on other sites

I've fiddled around a bit with the "shade the frobbed object better" idea and created something thats based on a .vfp file ( no, not the interaction ;) ). Hope Baal doesn't mind :)

 

It basically shades the object ( taking normal-map, specular, diffuse into account ) based on the position of the player and adds the result onto the object to get the frob-effect.

 

At some point i tried combining this with the "have loot shaded a bit differently" idea by just coloring the specular highlights with a "loot color", like some yellow tint. But that probably doesn't work too well for loot that has no specular or is very gold-like itself.

 

This could potentially be combined with the fresnel-based loot-effect, but i didn't get around to trying that yet.

 

Here's a comparison between the current default frob-highlight ( left ), and the potentially new way ( right ).

 

vfpfrob.jpg

 

Edit :

 

Unfrobbed Vase

 

nofrob.jpg

Link to comment
Share on other sites

It looks a little better, but it's hard to tell without seeing the non-frobbed version.

 

What do you mean by "based on the position of the player"?

Link to comment
Share on other sites

Huh, interesting. Well, anything that increases the detail of a frobbed object is worth a look IMO.

Link to comment
Share on other sites

Cool, that's how I imagined it. At least the idea was mine. :)

 

@rebb: I'm curious. Can you do that effect without SDK modifications? If I'm not mistaken you need to access some render state data in the shader and I didn't know how to do that.

Link to comment
Share on other sites

@Baal :

 

Yes it's just .vfp and material-file modifications. All vfp files get some basic information passed in, like eye-position and vertex-info etc.

 

For example the vertex-program part of this is just copied from bumpyEnvironment.vfp that comes with Doom3, and the fragment-program part is customized.

 

Did you also use a custom .vfp file for the image here ? http://forums.thedarkmod.com/index.php?showt...st&p=175427

Link to comment
Share on other sites

Yes, that was a custom .vfp shader. I just set a vertex parameter to a constant light vector in the material definition.

 

For the specular lighting you need the eye and light vectors and the tangent space transformation matrix (if I got that right). Is this accessible through the environment variables from a custom shader?

Link to comment
Share on other sites

Yes you need both eye and light position for specular if the light-position is not the same as the eye-position.

 

An earlier version of this used to have the light-position being somewhere else, but that looked a bit odd, so i ended up just having the light be in the eye position.

 

That frees up some calculations and still looks good for what it's supposed to do.

 

The tangent-space matrix should be available to every .vfp, yes.

Link to comment
Share on other sites

Is it possible to animate the frob effect, for example by slightly moving the light vector around a bit? If the highlight pulsed or shimmered gently this might serve to bring out the effect even in bright ambient light without having to do something more obnoxious.

Link to comment
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.


  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 6 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...