Commit Graph

8 Commits

Author SHA1 Message Date
Charles deRousiers
729a3656a8 Trim/Clean ShaderPrint shader API before it becomes public.
#rb none
#jira none
#preflight shaders
#fyi jeremy.moore

[CL 21268813 by Charles deRousiers in ue5-main branch]
2022-08-08 10:48:14 -04:00
Michael Forot
007c50544a Niagara + BP support for analytical physics fields
#rb devon.penney
#jira none
#preflight 62aaee14b066e89e7ee225ef

[CL 20684798 by Michael Forot in ue5-main branch]
2022-06-16 05:09:27 -04:00
Charles deRousiers
f63b1d1fd1 Move ShaderDebugDraw.ush into ShaderPrint.ush.
This is the final step for merging ShaderDrawDebug and ShaderPrint.

#rb none
#jira none
#preflight shader

[CL 19080703 by Charles deRousiers in ue5-main branch]
2022-02-22 16:18:29 -05:00
Charles deRousiers
7fb470c95b Rename ShaderPrintCommon.ush into ShaderPrint.ush
#rb none
#jira none
#preflight shader

[CL 19080041 by Charles deRousiers in ue5-main branch]
2022-02-22 15:58:29 -05:00
charles derousiers
f09bfbd7d0 Add LWC support for shader draw debug.
Draw function have now a WorldSpace (WS) and a TranslatedWorldSpace(TWS) variant.
Legacy functions are rerouted to the WS variant.

All engine code is converted into the new functions.

#rb none
#jira none
#preflight 61f2b2012c04e13185091316

#ROBOMERGE-AUTHOR: charles.derousiers
#ROBOMERGE-SOURCE: CL 18753731 in //UE5/Release-5.0/... via CL 18753750 via CL 18756948
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18757251 by charles derousiers in ue5-main branch]
2022-01-27 14:09:37 -05:00
Ben Ingram
14ea9b00e5 Merging Dev-LWCRendering into Main, this includes initial work to support rendering with LWC-scale position
Basic approach is to add HLSL types FLWCScalar, FLWCMatrix, FLWCVector, etc.  Inside shaders, absolute world space position values should be represented as FLWCVector3.  Matrices that transform *into* absolute world space become FLWCMatrix.  Matrices that transform *from* world space become FLWCInverseMatrix.  Generally LWC values work by extending the regular 'float' value with an additional tile coordinate.  Final tile size will be a trade-off between scale/accuracy; I'm using 256k for now, but may need to be adjusted.  Value represented by a FLWCVector thus becomes V.Tile * TileSize + V.Offset.  Most operations can be performed directly on LWC values.  There are HLSL functions like LWCAdd, LWCSub, LWCMultiply, LWCDivide (operator overloading would be really nice here).  The goal is to stay with LWC values for as long as needed, then convert to regular float values when possible.  One thing that comes up a lot is working in translated (rather than absolute) world space.  WorldSpace + View.PrevPreViewTranslation = TranslatedWorldspace.  Except 'View.PrevPreViewTranslation' is now a FLWCVector3, and WorldSpace quantities should be as well.  So that becomes LWCAdd(WorldSpace, View.PrevPreViewTranslation) = TranslatedWorldspace.  Assuming that we're talking about a position that's "reasonably close" to the camera, it should be safe to convert the translated WS value to float.  The 'tile' coordinate of the 2 LWC values should cancel out when added together in this case.  I've done some work throughout the shader code to do this.  Materials are fully supporting LWC-values as well.  Projective texturing and vertex animation materials that I've tested work correctly even when positioned "far away" from the origin.

Lots of work remains to fully convert all of our shader code.  There's a function LWCHackToFloat(), which is a simple wrapper for LWCToFloat().  The idea of HackToFloat is to mark places that need further attention, where I'm simply converting absolute WS positions to float, to get shaders to compile.  Shaders converted in this way should continue to work for all existing content (without LWC-scale values), but they will break if positions get too large.

General overview of changed files:
LargeWorldCoordinates.ush - This defines the FLWC types and operations
GPUScene.cpp, SceneData.ush - Primitives add an extra 'float3' tile coordinate.  Instance data is unchanged, so instances need to stay within single-precision range of the primitive origin.  Could potentially split instances behind the scenes (I think) if we don't want this limitation
HLSLMaterialDerivativeAutogen.cpp, HLSLMaterialTranslator.cpp, Preshader.cpp - Translated materials to use LWC values
SceneView.cpp, SceneRelativeViewMatrices.cpp, ShaderCompiler.cpp, InstancedStereo.ush - View uniform buffer includes LWC values where appropriate
#jira UE-117101
#rb arne.schober, Michael.Galetzka

[CL 17787435 by Ben Ingram in ue5-main branch]
2021-10-12 13:29:45 -04:00
Michael Forot
a4d6b60ff8 Fix ue5 CIS for the field visualizer
#rb charles.derousiers
#jira UE-117909

[CL 16728019 by Michael Forot in ue5-main branch]
2021-06-21 10:37:06 -04:00
aurel cordonnier
e0ad4e25df Merge from Release-Engine-Test @ 16624776 to UE5/Main
This represents UE4/Main @ 16579691 and Dev-PerfTest @ 16579576

[CL 16625248 by aurel cordonnier in ue5-main branch]
2021-06-10 13:13:24 -04:00