First Person Rendering - Handling attached light sources to first person hands

We are experimenting with the new First Person Rendering system and have run in to a few small issues, one of which affects our current setup.

A couple of first person weapon primitives we use, also have a point lights attached to them. For example, a hand holding a glowing orb.

If we set the hand to be First Person rendered - and change its FOV or Scale, then the point lights influence on the the mesh is from a different position.

The light source itself can also clip in to world geometry, unlike the first person primitives with a scale applied.

We have tried using a Niagara System as a light source, and experience the same issue.

What options do we have to also offset light sources in first person with respect to the First Person Rendering camera configuration?

Our current running assumption is we’d need to implement a system to cache the local position of the light component, and regularly project it in to first person space and derive a new local offset for the ‘illusion’ to continue working.

Has anyone else run in to this use case and found any good solutions?

Steps to Reproduce
Attach a point light component to your First Person Rendered primitive.

Note that the point light remains in world space, and the first person primitive with scaled FOV or Size - the lighting will change.

For the time being, and in lieu of any better options, we have made a component that holds an array of user specified FComponentReference, it caches the local position of the component on begin play, and, on Tick in TG_PostUpdateWork, it reprojects that position from World Space to First Person Place, and then applies that to the component.

So as the FPS FOV or scale changes, the SceneComponent is regularly relocated in first person space. This lets us keep a point light inside the palm of the FPV hands, for example, and also stops it clipping in to walls, the same as the hand and weapon primitives.

Of course, the more the FPV hands are scaled towards the camera, the position of the light might be correct, but its attenuation and radius andwhat not moves further away from what the artist authored - but we just ask them to keep this in mind, and test in game rather than.

Hi Justin,

This is a very interesting case and the first time this has been brought up. The first person feature works by applying a transform to primitives in the vertex shader and is driven by settings on the UPrimitiveComponent, so there’s currently no way to apply first person-ness to lights. Implementing proper FP support for lights is likely very involved as it needs to be taken into account by many different systems within the renderer and would need to somehow solve the per-view discrepancy. Given these constraints, I think your workaround goes in the right direction: You can use FMinimalViewInfo::TransformWorldToFirstPerson or UGameplayStatics::TransformWorldToFirstPerson to calculate a new position such that when you place your light at that position it will appear to be in first person. If you only modify the light position, I would expect the effects of attenuation and radius to stay roughly the same as authored by the artist: The FP transform generally produces positions that are fairly close to the original position, at least relative to the scale of the rest of the scene.

Let me know if I can help with any further questions related to this! And thank you for using the feature! :slight_smile:

Cheers,

Tim

Thanks Tim!

Glad to know our solution is in the right direction given the limitations - on our end it seems to work very well.

Cheers, Justin.