Jump to content
  • Advertisement
Sign in to follow this  
vidalsasoon

HDR shading sample?

This topic is 4839 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

My outdoor game supports shaders but it's at the point where it needs good lighting and shade. I'm having trouble understanding all that shader mumbo jumbo without an example... Where I could see this in action with C#?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by vidalsasoon
My outdoor game supports shaders but it's at the point where it needs good lighting and shade.

Do you actually want HDR (High Dynamic Range) lighting as per your topic, or are you just after advanced lighting?

Whilst I love HDR and do think it generates by far the best images I've seen in a long time, it is also possible to get some pretty brilliant effects just by implementing better lighting models in the pixel/vertex shaders and then picking a suitable shadowing algorithm (e.g. PSM/TSM shadow maps).

Quote:
Original post by vidalsasoon
I'm having trouble understanding all that shader mumbo jumbo without an example...

Where I could see this in action with C#?

Have you tried the SDK samples? HDRCubeMap and HDRFormats in particular?

Although, it does seem that the best sample (C++'s HDRLighting) doesn't have a MDX/C# counterpart. But I'm sure you could still have a look at the sample and get a good idea of what's actually going on [grin]

hth
Jack

Share this post


Link to post
Share on other sites
well from what I understand, HDR lighting can handle both shadows and lighting at the same time. also, word around the net is that HDR is a good thing.

I'm having trouble understanding how it all fits together however.

i.e. I have an ocean shader in my game (just a plane mesh that uses Ocean.fx). I'm not sure how HDR will pick up on it and draw shadows on the water or light it correctly... same goes for all the objects in my scene.

Maybe i'm moving too fast.

Share this post


Link to post
Share on other sites
Quote:
Original post by vidalsasoon
well from what I understand, HDR lighting can handle both shadows and lighting at the same time. also, word around the net is that HDR is a good thing.

I'm having trouble understanding how it all fits together however.

i.e. I have an ocean shader in my game (just a plane mesh that uses Ocean.fx). I'm not sure how HDR will pick up on it and draw shadows on the water or light it correctly... same goes for all the objects in my scene.

Maybe i'm moving too fast.

Yea, I think you don't really understand what HDR actually is. HDR isn't an illumination model (it doesn't light geometry) or a shadow model (it doesn't shadow geometry).

Read this intro from the 'HDR Lighting' sample:

Quote:

Lighting in the real world contains a very high dynamic range (HDR) of luminance values. The real world has about 10 orders of dynamic range (DR) for luminance values spread across the spectrum of darkness to brightness. On the other hand, a computer screen has a very limited display gamut (or range of luminance values): approximately two orders of dynamic range. The challenge to producing HDR rendered images is to map the real world HDR values into the limited gamut of a computer screen.

Basically, HDR allows you to map a wider range of brightness values on your screen. This makes everything look a lot better, since the real world has a very wide range of luminances.

Blooming, which you may have heard of, is a technique that applies artifical glares and streaks to really bright values. This makes it look similar to when you look into a bright light or the sun.

Quote:

I'm having trouble understanding how it all fits together however

The challenging part in all this is not really implementing each individual feature or effect. It's easy enough to have an app that showcases soft shadowing. However, it requires some finesse to combine soft shadowing, PRT, and HDR into the same rendering pipeline, while maintaining an acceptable level of performance.

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!