Shadowtype by Hull

Jun 6, 2012 at 12:02 PM
Edited Jun 6, 2012 at 12:03 PM

Hi guys, so long. My game is advancing fairy well, I think I'll have something nice to show really soon. Thanks to Krypton I managed to add a couple of nice gameplay features (not only visuals).

Anyway, here's my question: Right now, the shadow types depend on the light source, and not on the hulls. The thing is that I need every hull to be "Solid" except some specific ones, so it would be nice to have in the hulls the property ShadowType instead of having it in the light source. But I don't know if this is possible, so maybe I'm asking something quite difficult.

If that's impossible (or too hard) to implement, don't worry as I found a workaround (my hulls are rectangular, btw): Instead of having one rectangular hull, I have 4 thin hulls, one for each vertex and I deactivate them based on the light source position, so the light fully lights the object but not what's behind it, and still have a lightsource with ShadowType solid.

As you see, I made my own dirty solution, but I wanted to know if it is possible to make a more elegant approach :)

Cheers

Coordinator
Jun 7, 2012 at 11:03 PM

You should be able to render Krypton twice, once with each light type, and only render the hulls with that shadow type per render.

You wouldn't render to the scene though, you'd render to a different texture. Afterword, you'd add those two lightmaps together, forming the final lightmap, which you could then multiply on to the scene.

This is better served as an engine feature though, as it's not exactly "easy peasy".