Jump to content
The Dark Mod Forums

Cloudy ambients


OrbWeaver

Recommended Posts

Discussed here: http://forums.thedarkmod.com/index.php?s=&am...st&p=185202

 

I had a go at this and I can see it working quite well, with a bit of tweaking and possibly a few different "frequencies" of cloudiness for ambients of different sizes.

 

post-254-1243024768_thumb.png

post-254-1243024659_thumb.jpg

 

With a proper map the varied brightness could give the impression of general soft shadows that are not linked with any particular geometry.

Link to comment
Share on other sites

Yes, there is a potential danger of striping (a true 3D texture would be much better of course).

 

However, there's no reason (AFAIK) that an ambient light cannot be a giant projected light instead of an omni light, so at least the stripes could fall at an angle. You could even determine where the moon/main light source was, and angle the projected light appropriately.

Link to comment
Share on other sites

Would a "translate" keyword make that texture scroll along?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Make sure that the light-projection image has an alpha-channel filled with a value of 1 ( 0-255 scale ), or the fixed ambient light won't catch on.

 

I noticed something wasn't right with the "ambient" light rendering -- I'll try that, thanks.

Link to comment
Share on other sites

Would a "translate" keyword make that texture scroll along?

 

Yes it does. You have to make sure the texture is tilable obviously, and remove the "zeroClamp" keyword, but with a translate of 0.01 * time the motion is so subtle you barely notice it.

Link to comment
Share on other sites

I'm having trouble setting this up. I made a cloud texture with a black alpha 1 channel and saved it as a tga, 32 bit/pixel. The problem is that faces turned away from the ambient light are completely black, this is the material I made.

 

lights/ambientlightnfo_clouds
{
ambientLight

lightFalloffImage makeintensity( textures/lights/ambientlightnfo)

{
	forceHighQuality
	map textures/lights/ambientlightnfo_clouds
	colored
	zeroClamp
}
}

Link to comment
Share on other sites

Unfortunately, no. Doom3 automatically removes a fully black alpha-channel ( thanks id ).

You need to fill it with a value of 1. In Photoshop just put in RGB( 1, 1, 1 ) in the color-picker and fill the alpha-channel with that.

 

It's weird, i know :).

 

But so far it seems to have proven as a more reliable way to get non-coal-miner ambient lights in Doom3.

Link to comment
Share on other sites

This is very interesting, is it possible to use a 3d texture to prevent striping? Or does that have it's own drawbacks?

 

It is possible if you program your own engine (with the drawback being that 3D textures are massive -- basically you have 256 or 512 separate "slices" to build a cube texture), but Doom 3 does not offer them.

 

You need to fill it with a value of 1. In Photoshop just put in RGB( 1, 1, 1 ) in the color-picker and fill the alpha-channel with that.

 

Why is a constant alpha channel required anyway? Couldn't the shader just assume a fixed value, if it is not going to change?

Link to comment
Share on other sites

It tells the shader that the current light is supposed to be an ambient light.

This needs to be constant because otherwise you would get artifacts where the value isn't below the testing threshold.

 

The old version used a value that was passed to the shader by the rendering system, but this turned out to not be a reliable one and caused problems on certain cards.

Link to comment
Share on other sites

That is very cool. I do have a dumb question though: What steps can the mapper take to make sure that stuff within this ambient is still visible to the player? I.e., what if the player is unlucky and some crucial item that's normally visible in an ambient happens to have a cloud drift over it right then? Or are these not the same kind of ambients you'd use to make sure that stuff is sufficiently visible?

Link to comment
Share on other sites

It is possible if you program your own engine (with the drawback being that 3D textures are massive -- basically you have 256 or 512 separate "slices" to build a cube texture), but Doom 3 does not offer them.

That kind of 3d texture :) , I thought you meant something like a special falloff image.

Link to comment
Share on other sites

It tells the shader that the current light is supposed to be an ambient light.

This needs to be constant because otherwise you would get artifacts where the value isn't below the testing threshold.

 

Oh I see. Clever, in a "necessary but less-than-ideal hack" kind of way.

 

It's interesting that the light texture's alpha channel is available though; once I was experimenting with gloss map shaders, and never achieved success trying to use the alpha channel of the specular map for this purpose. I concluded that the game was simply not loading alpha channels from specular maps (or providing it to the shader); perhaps in fact this was the same problem with the removal of a black alpha map that you encountered here.

 

I do have a dumb question though: What steps can the mapper take to make sure that stuff within this ambient is still visible to the player? I.e., what if the player is unlucky and some crucial item that's normally visible in an ambient happens to have a cloud drift over it right then? Or are these not the same kind of ambients you'd use to make sure that stuff is sufficiently visible?

 

The clouds are actually very subtle; I had to go back and increase the contrast several times before you could even notice them in game. You would have to increase it a lot more before things could actually be obscured in the dark patches.

 

Besider, in my view anything crucial for the mission should certainly not be left buried in an ambient light somewhere.

Link to comment
Share on other sites

I got the ambient light working as it should. But when it didn't work and I got black texture on faces turned away from the light I did got an awesome depth effect in my entire map because the ambient light was casting shadows on all the textures normal map. I wish the ambient light somehow did use the texture's normal maps so nothing will look flat any more.

Link to comment
Share on other sites

@Orbweaver :

 

Thanks :).

Yes gloss-mapping is certainly possible, there are a few custom vfps that have them, with different ways of implementing it. I've been fiddling with it in my "fiddle-interaction", where the ambient-fix actually originated.

 

The Doom3 Art-Project that someone posted some time ago on Doom3World ( i forgot the name atm, that brown cave-like map with the artsy flashbacks etc ) also has a vfp with gloss-mapping.

 

@Flanders :

 

It actually uses the Normal-Maps, but in a subtle way so it doesn't end up introducing a different kind of coal-mine look on character-models.

 

If you use a standard light with disabled shadows, you should get the same look you got when the alpha-channel wasn't adjusted yet.

Link to comment
Share on other sites

It actually uses the Normal-Maps, but in a subtle way so it doesn't end up introducing a different kind of coal-mine look on character-models.

I noticed the normal maps of some characters faces make it look like asphalt rather than skin in bright light. Is there a value somewhere that determines the amount of normal map used for ambient light? I'd like to see for myself how it looks.

Link to comment
Share on other sites

Yes gloss-mapping is certainly possible, there are a few custom vfps that have them, with different ways of implementing it. I've been fiddling with it in my "fiddle-interaction", where the ambient-fix actually originated.

The Doom3 Art-Project that someone posted some time ago on Doom3World ( i forgot the name atm, that brown cave-like map with the artsy flashbacks etc ) also has a vfp with gloss-mapping.

 

I know gloss mapping is possible in some way; the problem was that the shader I found used the alpha channel of the diffuse map to set the glossiness, which I considered wholly unacceptable -- the alpha channel of the diffusemap is already used, so trying to make it serve two purposes at once is just going to be a recipe for confusion.

 

If the alpha channel of the specular map is available though, I think it would be a no-brainer to implement this in the interaction shader -- maps with no alpha could behave in the default way, whereas maps with alpha could modify the glossiness form the default.

Link to comment
Share on other sites

@ Flanders :

The look of things in ambient-light very much depends on how much shading is in the diffuse-map, if there is little to no shading in it, then there's only the subtle ambient-shading from the normal-maps trying to make things appear less flat.

 

There is no CVar controlling that effect, because its not possible to pass a value to the interaction-file.

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

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 0 replies
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 2 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • 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.
      · 7 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
×
×
  • Create New...