Jump to content

LightMass like system


Niosop
 Share

Recommended Posts

You can make an ambient occlusion map and use it with dynamic lighting. Several people have used this technique.

 

Were you talking about AO maps for individual models or for the scene as a whole? If you were talking about the whole scene, could you point me somewhere to learn more about how it would work w/ LE?

 

I was thinking it would be possible for us to create a pre-processing system that would bake selected lighting into the scene to improve performance. Here's how I think it would work, but I really don't know enough to even know if this is possible with LE, or if it would be desirable if possible w/ LE. It's how LightMass and the Unity LightMapping addon appear to work:

 

We'd need to be able to specify which objects are static and are dynamic.

We'd need to be able to specify if a light is static or dynamic.

We'd need to be able to specify if a light should light/cast shadows from dynamic objects, static objects or both.

The engine would have to make use of that information.

 

Then we could export all static objects being lit by a static light that affects static objects to blender or another raytracer and generate lightmaps/shadow maps/occlusion maps/whatever LE could use. Static lights that cast light on only static objects could be removed at runtime since the lighting info is baked in. Dynamic lights wouldn't be used for the baking because their properties/positions might change, so they'd still be processed at runtime. Static lights that affect both static and dynamic objects would have to be made to not affect the static objects at runtime since the contribution to the lighting of those objects would already be baked in. I think I could handle the exporting and blender integration part, but I don't know about the LE part.

 

Anyways, let me know if this is a stupid idea, or if you're plans for SSRT or GI or whatever would make this pointless, or if I'm way off the mark and don't understand how this stuff works (very likely).

Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX

ZBrush - Blender

Link to comment
Share on other sites

Lightmapping has some problems. Let's say you have two cars on a street. One is in a shadow, and one is in the sun. You lightmap the scene, so now each car has it's own unique lighting.

 

Now you can't render this scene with instancing, because the cars have different secondary UV coordinates and may even use different lightmap textures. :(

 

You would never be able to lightmap an outdoors scene at the same resolution our shadowmaps use, or anywhere close, because the texture memory required would be enormous.

 

The best way to do any precalculation like this would be to render an ambient occlusion map in Giles or 3ds max, and then use a special shader that just treats the AO map as part of the shader. You won't have unique lightmapping based on actual light positions, but it will blend nicely with the dynamic lighting, and you will still get fast instanced rendering.

 

Here is a good example:

http://forum.leadwerks.com/viewtopic.php?f=7&t=3599

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

I treid this one: Flatiron

Unwrapps and bakes the lights in your scene. You would have to export each model as an individual one with own texture or have a .lua with a switch to display your secondary mapping-id with the lightmap in it.

 

Battlefield2 used this. UV-CHannel 9 was reserved for the object lightmap. :(

  • Upvote 1

Pure3d Visualizations Germany - digital essences

AAA 3D Model Shop specialized on nature and environments

Link to comment
Share on other sites

I treid this one: Flatiron

Unwrapps and bakes the lights in your scene. You would have to export each model as an individual one with own texture or have a .lua with a switch to display your secondary mapping-id with the lightmap in it.

 

Battlefield2 used this. UV-CHannel 9 was reserved for the object lightmap. :(

 

+

or without flatiron, same process just using render to texture :huh:

Omid Saadat

OD Arts Blog

 

AMD Phenom II X4 940 - Geforce 8800GTS - 4GB RAM - XP x86

AMD 6000+ - Geforce 9800 GT - 2GB RAM - XP x86 (Home pc)

Intel Core i7 - Geforce 310M - 4GB Ram - Win7 x64 (Laptop)

Link to comment
Share on other sites

Where do you get your facts Josh?

 

UDK uses Lightmass, and it also utilizes model instancing AND texture streaming, with no problem.

 

So there is a way to overcome your "instancing is impossible situation".

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

A GPU only has so many texture units available, so it's impossible to render large numbers of instanced lightmapped objects. UDK uses many different kinds of lighting and shadows, so it's often hard to tell what is going on.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • 3 weeks later...

That does make sense. UDK has like 50 different light types. :blink:

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...