Jump to content
  • Advertisement
Sign in to follow this  
spek

Generating Lighting lookup textures / BRDF data

This topic is 3000 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there,

When looking at Velvet, anisotropic or BRDF demo's, they often use lookup textures for the lighting shaders. I'm using a similiar way where:
lookupCoord.x = dot( lightVec, normal ) //diffuse
lookupCoord.y = dot( normalize(eyeVec + lightVec), normal ) // specular Blinn

That's not too difficult. But how to create those lookup textures in the first place? I can either:
a: Just draw and test how it looks
b: Make a "gonio-reflecto-meter"
c: ...download free a tool?

Option B would be nice, but obviously way out of reach. Drawing them by hand is possible, but somewhat unpredictable. Some of the papers refer to a "Virtual Gonioreflectometer program", so maybe you boys/girls know a handy tool to for generating such images? Thanks!

Rick

Share this post


Link to post
Share on other sites
Advertisement
d: write a little command line tool

When you have an expensive formula to calculate something, try to put the most expensive part of it into a sub formula f(x,y)=... with x,y=[0..1]. Then write a little command line tool to calculate f(x,y) for each x,y value and save it in a buffer and finally in a texture. Either convet the results to a more or less packed byte coding or use a float texture format.

This command line tools are really cheap, if you want to avoid to include any image file format library just write to simple raw format which is supported by photoshop/gimp. Then use photoshop/gimp to convert it to your wished format.

Share this post


Link to post
Share on other sites
Hey! Well I actually already wrote a program that produces an image and directly tests it on 3D shapes. It will calculate a simple gradient (which results in default Lambert/Blinn lighting), or you can paste an image from the clipboard.

However, the real magic happens with the formula of course. And since I don't know the math for doing complex lighting models... Therefore I was wondering if there are tools that let you produce this data based on logical parameters, instead of randomly fooling around with gradients like I do :)

Cheers

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!