Download

Volumetric translucency with custom mesh component bug (link to answerhub)

Hi guys.

I have made a custom mesh component to render volume slices. It generates vertices to make planes along a vector that is halfway between the camera view and light view. it generates the slices in object space and then because it’s using localvertexfactory, the vertices get transported to the components transform. I just wonder if the shadows are being generated in the right ‘space’.

When I rotate the actor that contains the component, the shadows go through some weird rotation that doesn’t seem to line up with the light direction.

here is a video…

i can rotate a particle system and this doesn’t happen and wonder why its happening to my mesh. is it because the planes aren’t facing the camera? is it because the tangents are wrong? ( i do some cross products to generate flat tangents from the normal in object space.)

https://youtube.com/watch?v=BlIXaF4FGVY

https://answers.unrealengine.com/questions/217866/volumetric-shadows-wrong-when-rotating-actor.html

any ideas?

Cheers
Dan

I’ve hit upon what the issue is and have replied at the answer hub link.

Basically is a bounds issue. I need the bounds to be world aligned but also need the calcbounds function in the mesh component to return bounds based on the LocalToWorld Ftransform that are word aligned when transformed into world space.

I guess I’ll need to get the rotational part of the transform and multiply the vertices in object space and test the min/max there to make the Bounds.