HDR textures

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

HDR textures

Post by JPulham »

When modelling game environments for HDR game play.. what textures need to be in HDR format?
I know EnvMaps need to be.
Does the Lightmap need to be (probably yes :? ) and does the diffuse map need to be? (I might be able to get away with LDR diffuse).
pushpork
jingquan
Posts: 222
Joined: Sun Aug 20, 2006 4:10 am
Contact:

Post by jingquan »

Anything luminance like flood lights and glow in the dark stickers during the night. Most often it's used for the sky, outdoors during the day. I think if I'm to use HDR textures for my indoors design, I'll use it on shiny metallic objects.

The rest of the textures will probably be taken care by the envmap.
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

The important format is the framebuffer one, unless your texture will have pixels varying over a big dynamic range, you can just ramp up the light emmited from an object mathematically(just the colour output) rather than loading textures. if the texture has allot of variety in its light emmitance then you will need hdr textures.

The rgbe format may interest you in this case,since its easy to decode in the shader 3 inst cost and can be stored in a tga loadable by irrlicht(alpha channel has the brightness, using logs you can create brightness from the rgb and alpha of around 0 -20000) rgb ratio stays the same as normal so the rgbe format will artefact if you say display a very red colour with very small blue and green.

some people just use an extra ldr glow map and multiply by a brightness factor, but rgbe is cheap enough now.
"Irrlicht is obese"

If you want modern rendering techniques learn how to make them or go to the engine next door =p
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

Post by JPulham »

I was thinking of using the fake HDR found here:
http://www.ogre3d.org/wiki/index.php/Faking_HDR
This uses RGBe in the alpha channel. Basically I wanted to know which textures should be encoded this way.

once I've encoded them.. can I just expose them (exponential exposure) for LDR use? it should work... :?
pushpork
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

You still need bloom/tonemaps to actually see the hdr, encoding normal float values in a shader to rgbe and back allows you to store 0-22000 values in a texture which supports 0-255.

My last post was highlighting a big diffrence between a HDR framebuffer and a HDR texture, which one do you want(or both)?
"Irrlicht is obese"

If you want modern rendering techniques learn how to make them or go to the engine next door =p
fmx

Post by fmx »

wouldn't framebuffer operations to fake it be more computationally expensive than using HDR values directly?
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

Post by JPulham »

basically my game offers HDR/LDR options. All surfaces use a shader (directional radiosity and shadowmapping). The shader can then use either HDR textures and render to a 'fake' HDR target, which is used in combo with a bloom shader, or the LDR equivilent uses LDR textures and no bloom.
pushpork
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

You sound like your on the right path JPullham. Diffuse shouldnt emit light(only modulate the reflacted light) so it can be ldr in the hdr version, glow maps can be used for emmitance(can be ldr or hdr depending on the math you do in shader).
wouldn't framebuffer operations to fake it be more computationally expensive than using HDR values directly?
Well there a few things:
hdr values take more vram
hdr values are bigger and hence take longer to load<-not only at start up but during each texture read
Limited filtering modes
Antialiasing problems

all of these depend on the hdr format.

ALU power is always getting faster at a pace than memory speed, so 3 shader instructions are now faster than a large memroy read.
"Irrlicht is obese"

If you want modern rendering techniques learn how to make them or go to the engine next door =p
Post Reply