PDA

View Full Version : lighting + shadow



zed
11-05-2002, 10:44 AM
sort of OT (though still cg but as good as forum to post as any on opengl.org when are the new forums coming?)

the new doom3 stuff has got me wondering a few things + i would like a few expert opions (there are a few here http://www.opengl.org/discussion_boards/ubb/smile.gif)

UT2003 requires a gf/raddeon to run halfway decent(ie hardware t+l card) but it doesnt do bumpmapping AFAIKS (ive only seens screnshots), why on earth not?
surely halving the polygons + adding bumpmapping is a far better option than UT2003's current setup, now obviously UT is made by good programmeurs thus it was a question of not wanting + not being able to so any ideas why they didnt?
the reason i ask is there anything likely to bite me in the ass with using bumpmapping?

specular how important is it?
i havent added specular to my game (perhaps i will write a few shaders later that have it) i was out in the woods the day before yesterday sitting down looking around (i had a huge field of view but the only 'noticable' specular light i could see was from my beer can + a blade of grass if i plucked out a fresh shoot and held it in the right way in the sunlight, the rest of the world (+ there was nearly everything naturewise trees/tusock/thyme/snow (no water though) yet there was no specular)

also on a related note, go outside on a cloudy day, where are the shadows? the scenes shading is more akin to quake2 then doom3! though in cg having nice 'defined' shadows + 'overbright' lights looks better than realism.

also what textures to use for a diffusemap? ive found often a model will look better just with a bumpmap + a plain grey texture ie if u replace the grey texture with a 'proper' texture the object doesnt look half as good (it loses its 3dness?) my question is what sort of textures look good with bumpmapped models? i assume dont shade the diffuse texture at all (shading all comes from the bumpmap but even this doesnt seem to work)

lastly (an easy one) i dont follow computer games much so, what game on the pc is the most graphically amazing. eg has bumpmaps shadows etc. everything ive seen looks about the same level as quake3, but thats from 3 years ago surely we've advanced.there are a couple of console titles which look very good (Resident evil gamecube for example) but i want to see a pc one (ie that i can download a demo of and check out)

sorry about the sort of offtopic post (then again half the questions here are eg how to load a texture in opengl?)

zed

MZ
11-05-2002, 01:24 PM
Originally posted by zed:
also what textures to use for a diffusemap? ive found often a model will look better just with a bumpmap + a plain grey texture ie if u replace the grey texture with a 'proper' texture the object doesnt look half as good (it loses its 3dness?) my question is what sort of textures look good with bumpmapped models? i assume dont shade the diffuse texture at all (shading all comes from the bumpmap but even this doesnt seem to work)

Yes, i noticed this too...
I think its because typical textures used nowadays are not fitted for dynamic lighting
There are 2 problems: (based on purely subjective experience)

1. too big contrast in texture data
the contrast experience in real world comes mostly from light-and-shadow effects, not from "pigment"-like material properties - which are usually stored in textures. In todays engines both "pigment" and light'n shadow occupy the same 0-1 range of values, what is highly unrealistic ratio.

Example: no real-world material is black enough to give it RGB value of 0,0,0 (as commonly spotted in textures). Just give the material enough light, and it will look bright gray (what is obviously impossible when you modulate 0,0,0 value)

2. too low saturation in texture data (I mean S of HSV)
or in other words, hues stored in textures are much too "pure". In real world you never experience hues that close to pure R, G or B. I would risk guessing that all hues around me now are in 80% (at least) polluted with white. Unless you look at something like LED, neon or laser light - but these are exceptions that proves the rule.

BTW, it's not just for bumpmaps. When I rendered Q3 map with lightmaps only (no textures or shaders) then although it looked dull, it also looked a bit more real...


[This message has been edited by MZ (edited 11-05-2002).]

jwatte
11-05-2002, 01:41 PM
Bump maps, stored in RGB space (i e tangent space or object space normals) take up a *LOT* of texture space. As in, 8x more than a diffuse color map compressed using S3TC compression.

We're currently filling a 32 MB card (24 MB for textures) with S3TC textures. If we want 1:1 bump texel to diffuse texel coverage, we're looking at a 9x (!) increase in texture usage. 9*24 MB == 216 MB of texture usage.

Currently, cards sell with 64 MB of memory.

Perhaps we can get more sharing with bump maps than with texture maps; especially if we go tangent space and tile bump maps a lot (we uniquely texture diffuse color).

Perhaps we can also cut bump map needs in 4, by storing just a grayscale map and using m4d 5k1llz in a fragment_program to turn that into usable normal delta. But I can see how a game targeting DX8 level shaders, with a 32 MB card, would just forego bump mapping.

zed
11-05-2002, 06:18 PM
good ideas MZ ill play around with other colorspaces tonight to see if i can enhance the quality

>>But I can see how a game targeting DX8 level shaders, with a 32 MB card, would just forego bump mapping.<<

bumpmapping is dx6 hardware aint it! (i know what u mean though)
true objectspace mapping consumes much more memory (i use objectspace mapping cause its more furture proof IMHO)
but even using lower quality normalmaps (eg with a slider in game u can easily reduce texture memory usuage 1024x1024->512->256 16x less texture memory required. even with 256x256 sized normalmaps will no doubt look much better than higherquality textures without normalmaps, it still doesnt explain why UT2003 doesnt have normaps.
not that im complaining heavily about quality (i dont even renormalize my bumpmap normals with mipmaps http://www.opengl.org/discussion_boards/ubb/smile.gif)

btw i never know this but whats the correct term diffuse or decal as in diffuse/decal texture (ie the one that 'colors' an object)

harsman
11-06-2002, 04:36 AM
I was into 3d-graphics from the artistic side before I started programming so I have some ideas on what "Looks good" or not.

* Specular. Specularity is very important, even on things that look matte (sp?) or very diffuse. In reality the only things that look truly diffuse in a cg way are perhaps stuff made of chalk. Even if you don't see any bright highlights the effect is there for a lot of things. This is obvious if you look at test renders from good global illumination renderers, the objects usually have a standard white diffuse material and it makes them look like they're made of chalk or powdered clay. Still this is a subtle effect so if you want the speed you can probably sacrifice specularity for that type of scene.

*Even if there are no sharp shadows on a cloudy day there is still lighting. If you crawl into some bushes it will be darker in there and the sides of objects are lit differently depending on their orientation to the sky. This is also a subtle effect, but humans are really good at recognising these things. You could probably generate decent "soft" lighting with just a goos skylight model and strategic fill lights placed by artists though.

* You might want to look for textures that are used in high end 3d programs instead of "game" textures. Practically everything is bump mapped when doing photo realistic or "high end" cg, so texture need to just contain colour info, not geometric or lighting detail.

*I haven't seen any game lately on the PC that looked impressive. The last time I was impressed with a games graphics was with Vampire: The Masquerade by Nihilistic and that was released in 2000 or something. It still looks better than a lot of new games. If you want to see a good looking old school shoot em up download the demo of Starmonkey.

zed
11-06-2002, 11:23 AM
true in an ideal world u would have the whole she-bang specular(yes i know this is very basic requirement http://www.opengl.org/discussion_boards/ubb/smile.gif)/radiosity/bdrf etc but in practical terms this aint possible at 60fps. IIRC doom3 has like 7-8 textures per thing. diffuse + specular + lighting falloff etc ( ideally i would love to chuck the lighting falloff in a texture + do it from there (much easier) ) but that requires another texture unit (my card has only 2) so im doing it per vertex. my point is a lot of these things can be removed without making that much difference to the final image eg i can show some screenshots of doom3 that look like quake3 (yet they run at 10% of the speed). of course the shadows do make a big difference.

i believe the reason why objects look 'worse' with a decal texture on them is the same reason its much easier to take a nice looking black + white photo than it is a color one (the reason why its used very often, + not some artsy fartsy bollux reason thats often given) lighting is much more defined

ps im downloading starmonkey (vampire does look quite good as well) thanks for that.
sorry about the (quasi)rant

jwatte
11-06-2002, 02:10 PM
Zed,

There's a LOT of difference between the cost of specular, and the cost of radiosity and/or brdf.

zed
11-06-2002, 08:01 PM
i just realised you are jon watte (doh! i wonder why it never hit before).

of course theres a big differnce in cost between them, then again you could also argue one gives much more visual impact on the scene (as in radiosity vs specular, u pays your money and makes your choice i believe is the phrase)

this is of course depends on the scene, if the scene takes place in a room full of polished steel then perhaps specular has a bigger impact but normally radiosity has far more impact.

Tom Nuydens
11-07-2002, 05:44 AM
Originally posted by zed:
i believe the reason why objects look 'worse' with a decal texture on them is the same reason its much easier to take a nice looking black + white photo than it is a color one (the reason why its used very often, + not some artsy fartsy bollux reason thats often given) lighting is much more defined

... But color photos are more realistic. That's the major question here, IMHO: do we want graphics that have "impact", or do we want realism? Quake3 is a good example: they ditched Q2's radiosity because the artists didn't like it.

As for bumpmaps, it's true that they're hard to get right. You need textures that don't have any lighting in them, and a bumpmap that matches the original surface geometry. The only remotely practical way to do this AFAIK is to generate your bumpmaps off of high-poly models. I wouldn't want to have to model a detailed brick wall just so I can get a brick texture...

We're venturing into the 3D artist's realm here, but has anyone had any luck generating good textures and bumpmaps using photos for source material?

-- Tom

dorbie
11-07-2002, 06:43 AM
No they ditched radiosity because you can't make it work well with bump mapping (efficiently). You are hard pressed to make any ambient term work with bump mapping due to the inherent lack of directionality so only direct terms are rendered.

Tom Nuydens
11-07-2002, 07:00 AM
Dorbie, I was talking about Q3A, not Doom3. Q3A didn't have any bumpmapping whatsoever, nor did it have radiosity. I'm pretty sure Carmack or someone else at id cited lack of artist control as the main reason for not maintaining the radiosity in Q3A.

EDIT: Here's a link: http://www.eurogamer.net/features.php3?name=razercpl&page=13

-- Tom

[This message has been edited by Tom Nuydens (edited 11-07-2002).]

Ventura
11-07-2002, 07:02 AM
Dorbie, as i read from a quake3 presentation, they ditched the radiosity calculations in preference of raytraced diffuse light, because the artists could control the shadow effects much more effectively this way.
And the small matter of the radiosity taking _far_ longer to calculate, was making the larger maps a pain to update.

zed
11-07-2002, 07:16 PM
my decal/diffuse textures look a bit more defined now (not ideal but better than they were).
i turn down contrast + turn up the saturation of the decal/diffuse textures.
cheers MZ

MZ
11-08-2002, 06:40 AM
The contrast+saturation trick is kind of simple cheat for HDR problem, so if you would like the ideal solution you should do this:

1. scale+bias the "pigment" from textures to some realistic range (I mean some really *tiny* subrange of 0..1, as real materials are very far from being able to reflect (or absorb) 100% of given light)
2. then modulate by the light in linear color space
3. scale the outcome nonlinearly (exposure, gamma, etc.) back to 0..1