Jump to content

Light clipping/masking


psychoanima
 Share

Recommended Posts

I don't get it. You want to manually build shadow volumes when they are done automatically right now?

 

It's like asking why do you want to use masks in photoshop. I tought that idea is clear with this feature, you are masking the light where you don't need it, without adding geometry in front of the light source that is acting as a light blocker. In video industry they are using physical cardboards to shape the light, in digital word we are using masking methods with polylines, beziers, projected bitmaps etc. I know that this is possible with volumetric lights with geometry in front of that source, but this is cheaper to calculate and it's usable for static shadows.

 

How to solve this problem in Leadwerks: I want to project a shadow vignette on the wall/ground that has the shape of some object that is not physically in the scene (or it's present in the scene but I want to avoid extra light calculations). Like in the video example above.

Link to comment
Share on other sites

That reminded me a lot of Source's projected texture entity. For Portal 2, Valve made light masks to cast interesting shadows on top of the ruins of Aperture Science. And since all of Source's lights are baked, they were a scapegoat for dynamic shadows for doors and such. The entity can do so much more that lightmasks, but that's mostly what Valve used them for. The flashlight in HL2 is another example.

 

I recall Josh mentioning something relating to this in a hangout, or I must of dreamt it. Would be cool, seems like it will work well with the current render.

  • Upvote 1

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

I recall Josh mentioning something relating to this in a hangout, or I must of dreamt it. Would be cool, seems like it will work well with the current render.

LE2 had the projected textures for spotlights - refer to the old example with the flashlight. During a couple of hangouts, I have requested this feature and transparent colored shadows in LE3/4.

  • Upvote 1

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Why can't you just parent a plane to a spotlight? It would give the same effect unless they are doing something special that I don't know about.

 

Please check above video demonstration of Havok engine and light clipping featiure. Parenting a plane to a spotlight won't save time or memory in shadow calculation, full light casting is still out there(behind the camera, behind the polygonal object) If I have option to reshape spotlight it self (from cone to some unconventional shape) that will make bit more sense but still it will be difficult to make "fake shadows" (because light is projecting on the objects). And this light doesn't have to be dynamic at all, on contrary, it's excellent for tweak and bake procedure: for example, reshaping and baking shadows on the huge building or in the corridor for more dramatic/cinematic look.

 

Remember how environment probes are working? Now Imagine that you can reshape that box into some more complex geometrical shape so you can modify where reflection will ocur in the scene :)

  • Upvote 2
Link to comment
Share on other sites

Sorry, I saw the S2 video and thought that's what you were getting at. Correct me if I'm wrong here (which I might very well be since I'm not an expert in shadow techniques), but there isn't a way to prematurely discard fragments like that because you won't know where the fragment is until after rasterization, which is far down the pipeline (for either shadow maps or shadow volumes). You still run through pretty much the same rendering pipeline with shadow maps as you do with rendering everything else, so there's not much you're going to be saving. You could possibly save some fragment calculations, but even that's not guaranteed because fragments are computed in warps (Nvidia) or wavefronts (AMD).

 

Baking would be a cool feature, but that's an entirely different process. The environmental probe area suggestion seems interesting.

  • Upvote 1
Link to comment
Share on other sites

Sorry, I saw the S2 video and thought that's what you were getting at. Correct me if I'm wrong here (which I might very well be since I'm not an expert in shadow techniques), but there isn't a way to prematurely discard fragments like that because you won't know where the fragment is until after rasterization, which is far down the pipeline (for either shadow maps or shadow volumes). You still run through pretty much the same rendering pipeline with shadow maps as you do with rendering everything else, so there's not much you're going to be saving. You could possibly save some fragment calculations, but even that's not guaranteed because fragments are computed in warps (Nvidia) or wavefronts (AMD).

 

Baking would be a cool feature, but that's an entirely different process. The environmental probe area suggestion seems interesting.

 

 

This conversation is going in an interesting direction, that we may find a solution (at least theoretical)! :)

 

First we create the light. After that we create insulation.

 

Let's say hypothetically that the insulator is looking like an environment probe in the viewport (wireframed box). Where the box/insulator is located in the scene - that area is where light has effect, everything outside is out of calculation for that light. Same is with environment probe, what's outside the wireframe box is not calculated. Then to have a feature to add points/vertices to that wireframe box/insulator so we can reshape it. And as a final option to have dropoff settings to smooth the corners/edges

 

What do you (and the others) think?

Link to comment
Share on other sites

Lighting is different because you need a direction (unless you want ambient light). That is sort of how lighting already works. Lights have range and you use AABB intersections to apply the lighting to close objects. In an optimized setup for static scenes, you might even use KD-trees (although this allows for some movement). I mean it's an interesting idea, but lights also need to be physically accurate, and shaping the lighting in arbitrary ways breaks the physics of light. What you suggest is probably more appropriate for volumetric fog and environmental probes.

 

Now for volumetric light, you can do this somewhat, but you have a light source still and the rays can't be interrupted. Then, you would just need to make a mesh around the light. I personally don't see why that Havok demo makes sense though. I guess if you really need a custom area to be lit, but that seems unrealistic to me.

Link to comment
Share on other sites

I'd be interested in seeing what you actually want to use this on. Your account has no screenshots so it's hard to tell.

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

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...