It seems that the numbers are rounded in VertexFactoryCommon shader.
The cube consists of vertices that are very far from the origin and are placed on the screen by placing them at coordinates that are almost inverse vectors to the origin.
In VertexFactoryCommon , LWCToFloat(TranslatedWorldPositionOrigin)
will be a large value. This causes rounding in ResolvedView.PreViewTransform due to the camera coordinates added in the previous line due to float mantissa precision issues.
This effect is more noticeable because the vertex coordinate values are almost inverse vectors of the actor's coordinate values and appear larger on the screen.
Workaround:
FLWCVector3 PreciseLWCPromote(float3 Value) { float3 Tile = floor(Value/UE_LWC_RENDER_TILE_SIZE); float3 Offset = Value - Tile*UE_LWC_RENDER_TILE_SIZE; return MakeLWCVector3(Tile, Offset); } float4 TransformLocalToTranslatedWorld(float3 LocalPosition, FLWCMatrix LocalToWorld) { // Multiply local position with LocalToWorld 3x3 first for high precision rotation and scale, then move the world position part to translated world before adding it // ... FLWCVector3 TranslatedWorldPositionOrigin = LWCAdd(LWCGetOrigin(LocalToWorld), ResolvedView.PreViewTranslation); // modifier start FLWCVector3 RSPositionLWC = PreciseLWCPromote(RotatedScaledPosition); return float4(LWCToFloat( LWCAdd(RSPositionLWC, TranslatedWorldPositionOrigin) ), 1.0f); // return float4(RotatedScaledPosition + LWCToFloat(TranslatedWorldPositionOrigin), 1.0f); // modifier end }
It appears to be a gibberish displacement that is occurring.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-191945 in the post.
9 |
Component | UE - Rendering Architecture |
---|---|
Affects Versions | 5.2, 5.3 |
Created | Aug 3, 2023 |
---|---|
Updated | Aug 17, 2023 |