Doom3world

The world is yours! Doom 3 - Quake 4 - ET:QW - Prey - Rage
It is currently Fri Jul 30, 2010 10:07 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 66 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: Ambient Lighting - Slight update
PostPosted: Wed Jan 19, 2005 5:11 pm 
Offline
In trouble with the feds
User avatar

Joined: Sun Jan 18, 2004 10:41 pm
Posts: 2663
Note a small change in the shader code below... from "rgb global0 to red global0, green global1," etc.

I've implemented BloodRayne's ambient lighting technique for our map in order to remove the completely dark areas. For example, in the test vid when I was inspecting Mord's (awesome) building, I had to switch on the flashlight even though the sun was out and elsewhere it was very bright. Of course, the reason there was no light between Mord's buildings was due to the fact that the light that I was using as the "ambient light" was positioned in the center of the map, so any areas behind other buildings were not being lit. Now, in real life, surfaces reflect some amount of light, and that's why even a light with a small "volume" can light up an entire room. Since Doom3 can't do this (yet...) we'll just have to work around it. After looking at a number of different ambient lighting techniques and testing some of them out, I think BloodRayne's looks the best and is the most flexible for our needs.

Implementing BloodRayne's lighting technique has bonuses...

- No extra ambient lighting indoors that "bleeds in" from the outside.

- There's one less light that hits everything in the entire map. That means that the lightcount in the map is incredibly low... actually, it's one, plus whatever we put indoors or set up as street lights and such. The change also results in a small performance increase.

- Plus, I've altered BloodRayne's technique to use global shaderParms, so the ambient parameters can fade smoothly using scripts. And, if we wanted, we could sepreate "exterior" and "interior" textures and give them unique global parms so that we could have varying degrees of the ambient effect indoors and outdoors.


When I'm done, there will be no pitch-black areas in the map, only one light will be used for both the sun and moon, and mappers will have more artistic freedom when lighting their blocks.

I'm nearly finished with adding the code to all of the current textures (except for "interior" textures if they were specified as such). If you make any new textures, please add this code to them:

Code:
   {
      blend    add
      map   textures/euro/path-to-diffuse-texture.tga
      red   global0
      green   global1
      blue   global2
   }


So... the brick_red_lrg material would go from this:

Code:
textures/euro/shared/idiom/brick_red_lrg
{
   qer_editorimage   textures/euro/shared/idiom/brick_red_lrg/brick_red_lrg_d.tga

   diffusemap   textures/euro/shared/idiom/brick_red_lrg/brick_red_lrg_d.tga
   bumpmap      textures/euro/shared/idiom/brick_red_lrg/brick_red_lrg_local.tga
}


To this:

Code:
textures/euro/shared/idiom/brick_red_lrg
{
   qer_editorimage   textures/euro/shared/idiom/brick_red_lrg/brick_red_lrg_d.tga

   diffusemap   textures/euro/shared/idiom/brick_red_lrg/brick_red_lrg_d.tga
   bumpmap      textures/euro/shared/idiom/brick_red_lrg/brick_red_lrg_local.tga

   {
      blend    add
      map   textures/euro/shared/idiom/brick_red_lrg/brick_red_lrg_d.tga
      red   global0
      green   global1
      blue   global2
   }
}


Of course, I've saved all of the old material files, so if folks decide that we don't want to use this technique, we can revert with little effort.

Let me know what you think.

Goliath

_________________
D3W Staff
Quake-Live.tv - Live Shoutcasts, Video On Demand, Podcasts of the NA QLive Comp Scene


Last edited by goliathvt on Wed Jan 19, 2005 6:00 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Ambient Lighting
PostPosted: Wed Jan 19, 2005 5:58 pm 
Offline
has joined the game

Joined: Thu Nov 25, 2004 10:37 am
Posts: 47
goliathvt wrote:
Let me know what you think.


As soon as you give me screens, I will! :)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 19, 2005 5:58 pm 
Offline
Plasma Spammer
User avatar

Joined: Fri Aug 13, 2004 4:39 pm
Posts: 2557
Location: 5.566.120 posts
(sorry for the offtopic post of mine)
Thanks, sometimes I can overlook the most stupidest things. I'll be implementing the global parm as well. :D

_________________
Hexen:Edge of Chaos TC.
Download Sanctity, A Total Conversion for Doom3


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Wed Jan 19, 2005 7:12 pm 
Offline
In trouble with the feds
User avatar

Joined: Sun Jan 18, 2004 10:41 pm
Posts: 2663
I haven't quite tweaked everything yet, but here's a quick idea of what the changes will do:

Day Before Ambient
Image


Day After Ambient
Image

This is using an RGB level of .2, .2, .2. There is one light in the scene (the sun).

During the day and at the "transitions" from night to day, the ambient color fades smoothly over time.

Night Before Ambient
Image


Night After Ambient
Image

Note the slightly blue tinge to the building. This is done by setting the ambient level for the blue channel slightly higher than the red and green. I haven't tweaked this at all, though, so it's not even the same color as the moonlight (I ran out of time last night).

Still, it should give you a rough idea of what things will look like w/ this change.

Oh, and a quick note: All of the bump mapping and everything still looks incredible... nothing looks terribly "washed out," which was one of my biggest fears. Instead, everything still shimmers and looks really gorgeous, especially with the moving sunlight. The pics above really don't do it justice.

G

_________________
D3W Staff
Quake-Live.tv - Live Shoutcasts, Video On Demand, Podcasts of the NA QLive Comp Scene


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 19, 2005 7:48 pm 
Offline
Quad Damage!
User avatar

Joined: Tue Jun 22, 2004 6:57 pm
Posts: 4771
Location: Green Bay, WI
question:

what happens when an object (a monster or a vehicle) passes thru one of those "total black" areas? will they not also be black?

_________________
Don't take the swine flu shot!


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Wed Jan 19, 2005 7:54 pm 
Offline
Plasma Spammer
User avatar

Joined: Fri Aug 13, 2004 4:39 pm
Posts: 2557
Location: 5.566.120 posts
pbmax wrote:
question:

what happens when an object (a monster or a vehicle) passes thru one of those "total black" areas? will they not also be black?


Generally, the tweaks are so light that this isn't an issue at all. With the EOC mod we're not running into any trouble when this is concerned.

_________________
Hexen:Edge of Chaos TC.
Download Sanctity, A Total Conversion for Doom3


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Wed Jan 19, 2005 7:58 pm 
Offline
In trouble with the feds
User avatar

Joined: Sun Jan 18, 2004 10:41 pm
Posts: 2663
Here's a quick bumpmap test... you can see that the wall doesn't look washed out:

Wall with direct moonlight, no ambient light
Image

Wall with direct moonlight and ambient light
Image

Wall with no direct light, no ambient light
Image

Especially note how dark the corner of the Embassy is in the shot above.

Wall with no direct light and ambient light
Image

And here, you can see it quite well.

G

_________________
D3W Staff
Quake-Live.tv - Live Shoutcasts, Video On Demand, Podcasts of the NA QLive Comp Scene


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 19, 2005 8:45 pm 
Offline
In trouble with the feds
User avatar

Joined: Sun Jan 18, 2004 10:41 pm
Posts: 2663
Yes, pbmax, monsters will appear pitch-black unless you modify their materials. Fixing a monster is just as easy as any other material, though. Monsters will look a bit more washed out than walls, but not as flat as, say, characters in HL2.

G

_________________
D3W Staff
Quake-Live.tv - Live Shoutcasts, Video On Demand, Podcasts of the NA QLive Comp Scene


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 19, 2005 9:05 pm 
Offline
has joined the game

Joined: Fri Nov 26, 2004 5:55 pm
Posts: 26
That's what I was talking about in the Showcase Video 2 thread. Really nice, looks a lot more convincing now. I'd like to see some screens of objects casting a shadow. 8)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 19, 2005 9:42 pm 
Offline
Quad Damage!
User avatar

Joined: Tue Jun 22, 2004 6:57 pm
Posts: 4771
Location: Green Bay, WI
great stuff...

when will we be able to download the latest build?

_________________
Don't take the swine flu shot!


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Wed Jan 19, 2005 10:03 pm 
Offline
found a secret
User avatar

Joined: Sun Nov 10, 2002 1:21 pm
Posts: 576
Location: UK
I'm proberly just missing something but what about the specularmap?

In your code example the textures has two diffuse entries and no specularmap.

_________________
ASUS P5N32-E SLI Plus nForce 680i SLI / Intel Core 2 Duo E6850 3.00GHz 4MB Cache 1333MHz FSB
Asus 8800GT 512MB GDDR3 DVI PCI-E / Samsung Pebble SM2232BW 22" TFT 1680x1050 DVI
Corsair 2GB Kit DDR2 800MHz/PC2-6400 / 500GB SATA2 7200RPM 16MB Cache


Top
 Profile E-mail  
 
 Post subject: Sorta (well mostly) off-topic
PostPosted: Thu Jan 20, 2005 3:27 am 
Offline
fired 300 rounds

Joined: Sat Jan 15, 2005 1:51 am
Posts: 364
Location: Sydney, Australia
Looking at the latest test demo and the screenies above using the ambient light thingo (looks fantastic BTW) I got to wondering about where the player would spawn (ie info_player_start). Given that every second forum post around (except for here) seems to refuse to concede that D3 can do well-lit outdoor areas, why not tease them a little bit by having the player start in a dimly lit corridor and let them walk along a bit and perhaps turn left, go up some steps and emerge outdoors (I was thinking of the Underground steps where the water demo is currently). When I say dimly lit, I don't mean flashlight dim, just dark enough to look no different to every other Doom3 map out there...

Just enough for people to think "*sigh* here we go again" and thus reinforce the visual impact of the real D3CDIT mod area. You could also place credits as grafitti on the wall.

Anyway, just a random thought..


Last edited by radix2 on Thu Jan 20, 2005 6:20 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 20, 2005 4:26 am 
Offline
a gun & a nice word
User avatar

Joined: Sat Jan 11, 2003 9:30 pm
Posts: 8536
Location: Orlando, FL
Heh heh. :)

_________________
Image Staff
Learn something today? Why not write an article about it on modwiki.net?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 20, 2005 4:46 am 
Offline
picked up 100 armour

Joined: Thu Nov 13, 2003 11:17 pm
Posts: 126
First this looks great.

Second one question. Where do you set your red, green, blue values and would it be possible for the global values to change while the map is running? So that you have different ambient light, say during the day and at night? I wasn't sure if you were implying it already did that or not. If it can do this with out a performance hit, well, I cannot say how awesome that is, it would allow for really amazing lighting work to be done in the engine.

If it cannot be done, well it still looks great right now.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 20, 2005 6:35 am 
Offline
In trouble with the feds
User avatar

Joined: Sun Jan 18, 2004 10:41 pm
Posts: 2663
Yes, sxotty, I already do this through scripts. You can alter the global0, global1, global2 values by doing:

sys.setShaderParm(0, someValue);
sys.setShaderParm(1, someValue);
sys.setShaderParm(2, someValue);

where 0 through 2 correspond to the global#'s.

G

_________________
D3W Staff
Quake-Live.tv - Live Shoutcasts, Video On Demand, Podcasts of the NA QLive Comp Scene


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 21, 2005 6:34 am 
Offline
picked up 100 armour
User avatar

Joined: Wed Jan 19, 2005 1:41 am
Posts: 126
Location: Kolkata (Calcutta), India
When I first saw the later screenshots of EoC, I was dissapointed how even the indoors which were supposed to be darker(especially as its horror-based) lit up like one of those shitty console games :( . But this one seems the ideal Remedy :D .
I'm also looking forward to see some huge dynamic lightning lights used in a level. I think EoC should have it. Usually games uptill now has lightning affecting a very small area(as fas as I remember).
Keep it up Guys. :wink:

_________________
My LinkedIn Profile


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 01, 2005 12:41 pm 
Offline
is connecting to Doom3world.org

Joined: Mon Jan 31, 2005 4:15 pm
Posts: 9
it looks much better without ambient light, but darker too


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 01, 2005 3:58 pm 
Offline
picked up the chaingun

Joined: Tue Nov 23, 2004 7:54 pm
Posts: 161
Location: Grand Land of CANADIA
Does this ambient light system create the "tint" as an overlayed extra stage in the material that blends in with the Diffusemap, bumpmap, and specular map to overlay a tint? Or is it it just altering the how the diffusemap is displayed?

BTW that's a really kickass lighting system you guys came up with. It'll get some of the no dark spot bonuses of precalculated lighting, with the day/night shifting, and colour sweetness of Dynamic lighting.

Also, I was wondering how I could tie a light in my block to the sun/moon. I have a skylight that I'm going to put a "beam of light" particle effect and a spotlight. I'd like their angle to correspond to where the sun/moon light entity is.

Would making a texture for the light with the global rgb parms make it brighten/darken and change color appropriately? Or would I have to edit the light entity further


Top
 Profile  
 
 Post subject: Re: Ambient Lighting - Slight update
PostPosted: Wed Feb 02, 2005 8:29 am 
Offline
missed 400 shots
User avatar

Joined: Wed Sep 29, 2004 2:53 am
Posts: 427
Location: Melbourne, Australia
goliathvt wrote:
Code:
textures/euro/shared/idiom/brick_red_lrg
{
   qer_editorimage   textures/euro/shared/idiom/brick_red_lrg/brick_red_lrg_d.tga

   diffusemap   textures/euro/shared/idiom/brick_red_lrg/brick_red_lrg_d.tga
   bumpmap      textures/euro/shared/idiom/brick_red_lrg/brick_red_lrg_local.tga

   {
      blend    add
      map   textures/euro/shared/idiom/brick_red_lrg/brick_red_lrg_d.tga
      red   global0
      green   global1
      blue   global2
   }
}

Goliath


Does that mean you could have a diffusemap that had fake shadows for the blend add stage? That would mean it would sort of look like traditional (non-normal mapped) texture styling could be used and fake specular heighlighting?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 03, 2005 12:23 am 
Offline
a gun & a nice word
User avatar

Joined: Sat Jan 11, 2003 9:30 pm
Posts: 8536
Location: Orlando, FL
Hey Goliath, when you get a chance throw this in that stage instead and tell me what you think...

Code:
   {
      forceHighQuality
      nopicmip
      blend      add
      cubemap      env/rad
      texgen      reflect
      red      global0
      green      global1
      blue      global2
   }


Here's the cubemap...

http://www.geocities.com/rich_is_bored/rad_test.zip

This may work a little better as it will also factor in the direction a surface is facing.

I just think that this won't wash the textures out so much.

_________________
Image Staff
Learn something today? Why not write an article about it on modwiki.net?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 66 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group