Commit Graph

261 Commits

Author SHA1 Message Date
Ben Ingram
7072c6557d Run two passes of PrepareExpression, first pass to determine types, second pass to flag expressions that are used.
This way we can skip flagging constant/zero expressions (which we don't know about during the first pass)
#rb none
#jira none
#preflight 6227cb21671c913c052ca22f

[CL 19311693 by Ben Ingram in ue5-main branch]
2022-03-08 16:47:52 -05:00
Ben Ingram
a6d3274332 Fix material editor preview thumbnails when using new HLSL translator
#jira none
#rb none
#preflight 621ff47231454c90cc0e53de

[CL 19232396 by Ben Ingram in ue5-main branch]
2022-03-02 18:09:26 -05:00
Ben Ingram
b6f8dbd89b Use HLSLTree to generate cached data when using new HLSL translator
This allows cached data to be based on expressions that are active/connected
#rb none
#jira none
#preflight 621fce7831454c90cc079dd2

[CL 19227403 by Ben Ingram in ue5-main branch]
2022-03-02 15:20:48 -05:00
Ben Ingram
e6f2147048 Misc fixes for enabling/disabling control flow in material editor
#rb none
#jira none
#preflight none

[CL 18573247 by Ben Ingram in ue5-main branch]
2022-01-11 11:51:35 -05:00
Ben Ingram
ff516caf95 Hide UMaterialFunction UI options for new HLSL generator/control flow, if the global CVARs are disabled
#rb none
#jira none
#preflight none

[CL 18567303 by Ben Ingram in ue5-main branch]
2022-01-10 19:25:13 -05:00
Ben Ingram
6f2cbfee8c New material HLSL translator supports functions using control flow
#preflight 61dcc5b94d377749b662ee15
#jira none
#rb none

[CL 18567176 by Ben Ingram in ue5-main branch]
2022-01-10 19:10:49 -05:00
ben ingram
5dae45efae Hand integrate CL 17250155:
Prevent stack overflow from material editor setting color from details view that doesn't own current color picker.
#jira UE-120042
#rb none

#ROBOMERGE-AUTHOR: ben.ingram
#ROBOMERGE-SOURCE: CL 18238668 via CL 18239212 via CL 18239370 via CL 18240762 via CL 18240831
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18242931 by ben ingram in ue5-release-engine-test branch]
2021-11-18 15:23:37 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
aurel cordonnier
a12d56ff31 Merge from Release-Engine-Staging @ 17791557 to Release-Engine-Test
This represents UE4/Main @17774255, Release-5.0 @17791557 and Dev-PerfTest @17789485

[CL 17794212 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-12 21:21:22 -04:00
ben ingram
0bb0a923a0 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

#ROBOMERGE-AUTHOR: ben.ingram
#ROBOMERGE-SOURCE: CL 17787435 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v881-17767770)

[CL 17787478 by ben ingram in ue5-release-engine-test branch]
2021-10-12 13:31:00 -04:00
andrew davidson
57beb335f2 Merging //UE5/Dev-LargeWorldCoordinates [at] 17581892 to //UE5/Main
#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 17595295 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257)

[CL 17595306 by andrew davidson in ue5-release-engine-test branch]
2021-09-22 10:01:48 -04:00
aurel cordonnier
7f517562d5 Merge from Release-Engine-Staging @ 17438845 to Release-Engine-Test
This represents UE4/Main @17430120 and Dev-PerfTest @17437669

[CL 17439044 by aurel cordonnier in ue5-release-engine-test branch]
2021-09-06 12:23:53 -04:00
ben ingram
84d2bffbc3 Fix pin index assignments when collapsing material nodes
#rb none
#jira UE-121677

#ROBOMERGE-SOURCE: CL 17391239 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17391245 by ben ingram in ue5-release-engine-test branch]
2021-09-01 15:30:38 -04:00
ben ingram
c0a303be42 Continuation of previous material parameter refactor. Replace FMaterialRenderProxy Scalar/Vector/Texture parameter query functions with generic version
#rb none
#jira none

#ROBOMERGE-SOURCE: CL 17378446 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17378452 by ben ingram in ue5-release-engine-test branch]
2021-08-31 17:38:39 -04:00
ben ingram
2351588c6a Add texture cube array assets, support for sampling in materials
#rb graham.wihlidal
#preflight 611ebf1a2c1f1c0001355fe7

#ROBOMERGE-OWNER: ben.ingram
#ROBOMERGE-AUTHOR: ben.ingram
#ROBOMERGE-SOURCE: CL 17240322 via CL 17268789
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v858-17259218)

[CL 17268797 by ben ingram in ue5-release-engine-test branch]
2021-08-23 12:36:17 -04:00
aurel cordonnier
dc4bf61540 Merge from Release-Engine-Staging @ 17030559 to Release-Engine-Test
This represents UE4/Main @ 17030256 and Dev-PerfTest @ 17030553

[CL 17031509 by aurel cordonnier in ue5-release-engine-test branch]
2021-08-03 11:56:47 -04:00
jason nadro
ccf73c6f27 Fix crash in the material editor when running with -onethread.
- Let the game thread remove its reference before the deferred deletion so we don't trigger a non-zero ref count check in ~FMaterial.

#rb Ben.Ingram
#preflight 610071545938f90001e90c85

#ROBOMERGE-SOURCE: CL 16975782 via CL 16975842
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v838-16927207)

[CL 16975864 by jason nadro in ue5-release-engine-test branch]
2021-07-27 18:49:38 -04:00
ben ingram
e286aecd18 Remove code in UMaterialGraphNode_Base that associated additional data with pins via a TMap
Instead, add 'SourceIndex' directly to UEdGraphPin and remove the map
Too many edge cases where something would modify pins directly, and the map would get out of sync with actual pins
#jira UE-119861
#rb lauren.barnes

#ROBOMERGE-SOURCE: CL 16897567 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16897572 by ben ingram in ue5-release-engine-test branch]
2021-07-20 11:49:47 -04:00
aurel cordonnier
02c0f425e8 Copy up from Release-Engine-Staging @ 16738359
This represents UE4/Main @ 16738161 and Dev-PerfTest @ 16737719

[CL 16738582 by aurel cordonnier in ue5-release-engine-test branch]
2021-06-22 00:27:54 -04:00
kevin ortegren
73961aeb42 Adding a "Preview Blend Mode" on material functions that allows you to modifying the blend mode of the preview material. This is saved off on the material function so that artists can pick what they'd prefer the default preview behavior to be.
Contributed by The Coalition

#rb ben.ingram
#jira none

#ROBOMERGE-SOURCE: CL 16347000 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v804-16311228)

[CL 16347005 by kevin ortegren in ue5-release-engine-test branch]
2021-05-17 06:46:40 -04:00
Lauren Barnes
39f1923ed0 Deprecating .Icon() as a slate attribute on SDockTab. By default, tab icons fall back to using the one for the tab spawner's menu item. SetTabIcon can be used in the edge cases where an icon needs to be set that doesn't match the default. Updating all found cases of .Icon() usage on SDockTab.
#jira UETOOL-3429
#preflight 60996a2bdd2e00000126ff25
#rb Matt.Kuhlenschmidt

[CL 16251489 by Lauren Barnes in ue5-main branch]
2021-05-10 14:19:15 -04:00
christopher waters
688c029803 Tessellation Removal: Removing Tessellation specific material parameters.
#jira UE-94564
#rb ben.ingram, sebastien.hillaire, arciel.rekman, jason.nadro
#preflight 6078b15161a9060001161a4c

[CL 16034000 by christopher waters in ue5-main branch]
2021-04-16 10:46:28 -04:00
Marc Audy
01b7c9f4f5 Merge UE5/RES @ 15958325 to UE5/Main
This represents UE4/Main @ 15913390 and Dev-PerfTest @ 15913304

[CL 15958515 by Marc Audy in ue5-main branch]
2021-04-08 14:32:07 -04:00
Jason Nadro
336216390d Only display the strata material description if it exists.
#rb sebastien.hillaire
#review @sebastien.hillaire
#jira none

[CL 15823401 by Jason Nadro in ue5-main branch]
2021-03-25 10:40:27 -04:00
Sebastien Hillaire
c10078a527 Fix for preview to not try output Strata type.
#rb Rune.Stubbe

[CL 15797843 by Sebastien Hillaire in ue5-main branch]
2021-03-24 09:38:42 -04:00