View Full Version : Help with Renderman IBL shader
tweeeker 10-27-2004, 07:51 AM Hello there.
I'm trying to write my own image based light shader for renderman. Thats quite ok except that I have a fundimental flaw in my knowledge that I'm hoping you guys can help me out with:
Quick recap: I take my photos at multiple exposures and combine them into a floating point tiff in HDRShop. This goes fine. Now I have an image where 1 is the brightest and 0 is the darkest. I convert the tif to a floating point tex file. So now when I apply this image to my light shader the light is mostly very dark because much of the data is in the very low end of the image. So I try and multiply the values from the image - but this is where the trouble starts - because just multiplying the values to make them brighter screws with the colors. I don't understand how this 0-1 image relates back to my separate, different exposed images.
What I need to know is say, when you press the + and - keys in HDRShop to simulate various fstops, what math is it actually doing? Ideally I'd like the 'default' exposure in the light shader to be the 'middle' of the range of light available in the hdr image, with an additional 'stop +-' type paramater to control the exposure.
Also would openEXR be better for me than floating point tiff? i.e does openEXR store data about the actual shutter/apature values as opposed to just the 0 to 1 range?
Thanks in advance
T
|
|
Andrew W
10-27-2004, 08:57 AM
If the values in your image range from 0-1 then it probably isn't high dynamic range. Whilst I suppose you could compress a high dynamic range into the 0-1 region (assuming you're using floating point values) it's highly unlikely and most packages don't do this. You need to make sure that you export from HDRShop as a floating point TIFF and then when you txmake your image use the -float tag otherwise txmake will clamp your image.
Each + or - in HDRshop doubles or halves the brightness of the image, exactly the same as a change in f-stop does on a camera.
Hope that helps
Andrew
rendermaniac
10-27-2004, 09:28 AM
If you open yuor image back up in HDRshop there is a button - I think it's Image > Scale to this exposure or something like that. (don't have it open right now). This will scale the image so that the current display exposure is the middle of your range. (the scale is arbitrary anyway).
Alternatively if you want an exposure control you just need to adjust the brightness in stops. This is a logarithmic scale so increasing the exposure by one stop doubles the intensity.
Cl *= pow( 2, exposure);
Simon
tweeeker
10-27-2004, 04:38 PM
Hi Andrew - my image is definately floating point tif. When I re-open it in HDRShop and hover over a pixel I can read the color value from the status bar at the bottom. These color values are all in the 0 - 1 range. So even though the pixel is say bright green on the monitor, the color values read 0.01 0.04 0.01 - ie very low in the 0 to 1 range.
Basically, when I open up the image in digital fusion it shows up the same as when I render in renderman - mostly very dark because the values are generally very low (as verified in hdr shop). When I open in HDRShop the default display is the same as the lowest exposed image I used to create the hdr file in the fist place. So - how does HDRShop know to display it like this, given 0 - 1 pixel values? If I just multiply the values in digital fusion I can still never get it to look the same as it does in HDRShop, it always gets that over gained over saturated look. So HDRShops +- stop seems not to be simply multiplying the pixel values.
Simon, thanks for the exposure tip but this is still ultimately a multiplication which seems is what is giving me the problem.
Any more thoughts guys? this is confusing the hell out of me..
thanks
T
playmesumch00ns
10-27-2004, 04:59 PM
If you really have got the full range in your image, then all you need to do is whack the intensity in your IBL shader right up and hey presto.
tweeeker
10-27-2004, 05:33 PM
Hey it turned out just to be the gamma correction! HDRShop was applying 2.2 gamma to the hdr image (which allows it to match the various source images) while setting gamma to 1 makes the HDRShop image match the digital fusion/renderman image.
So I'm guessing that if my plate has 2.2 gamma, then I should apply 2.2 gamma in my shader so that they match? Otherwise the light in the plate is generally much brighter than the light I get from the hdr image.
Thanks
T
rendermaniac
10-27-2004, 08:14 PM
Ah. I've been caught out by that one before! It applies it per image as well which can also get you...
Personally I'd advise not doing any gamma correction in 3D. Do it in 2D afterwards where you have more control. This means really you should correct the plate you are lighting to to remove any gamma response - you can view it properly by applying the gamma in the display driver with a LUT. This is how most places do it anyway.
This is because the image you are using - if you have combined it properly in HDRshop, should give you a linear response exactly the same as the light in your scene. If you apply a gamma then you are altering the way light responds and your shaders can be unpredicatable. This is the same with compositing operations which expect linear input too. Although sometiems you can get away with it if you're lucky.
The bit where HDR image based lighting breaks down a bit is where the plate you are matching already has a grade on it. As the HDRshop process is designed to get rid of this!
This is where trickery and deceit come it ;)
Simon
shehbahn
10-27-2004, 08:44 PM
>then I should apply 2.2 gamma in my shader so that they match?
what Rendermaniac just said above. however, you can also use the exposure feature (RiExposure - check your Render Globals) to apply a gamma post shading.
also : make sure that the textures you are using on your model are in the appropriate color space...
tweeeker
10-27-2004, 08:52 PM
While we're on this subject have any of you guys used HDRShop v2? The new features look really cool but at $600 it's not for messin' around at home with. I have a canon digital camera so version 2s ability to use RAW files directly and build the hdr image from the meta data sounds really cool. As I said before, I'm not sure at this point if there is any advantage using openEXR over floating point tiff although it would seem benificial to be able to keep the exposure info around for the shader to have access too (although I'm guessing this would most likely be lost by txmake anyway?).
Thanks
T
rendermaniac
10-27-2004, 11:06 PM
The main benefits from OpenEXR are disk space saving - especially the half 16 bit version.
Simon
tweeeker
10-28-2004, 07:41 AM
OK thanks guys. First I'm gonna go and find out the exact gamma for my camera cause it may not be exactly 2.2. I'd have thought that 16bit RAW files would have been stored linear but seems not as the RAW files always look the same as the Jpegs.
thanks
T
rendermaniac
10-28-2004, 11:27 AM
the calibration part of HDRshop works out the response curve for your camera. The combining step then removes this curve from your image data - hopefully cancelling out any effect from the camera system.
Your floating point image should look slightly different that your RAW file (both at gamma 1.0) as the RAW file still has the effects of the camera curve on it.
A gamma of 2.2 is a very approximate number used as an average for the correction of a normal system and shouldn't be replied upon. Real systems have far more complicated responses. Note that the final gamma is the system gamma and includes the gamma's of the lens, CCD, any in camera processing (hopefully none with RAW) etc.
Simon
CGTalk Moderation
01-19-2006, 05:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.