Commit Graph

3803 Commits

Author SHA1 Message Date
graham wihlidal
96ec8cb15a Fix for NaniteVertexFactory UV out of bounds compilation errors in some situations.
#rb rune.stubbe


#ROBOMERGE-SOURCE: CL 16613250
#ROBOMERGE-BOT: (v828-16531559)

[CL 16614304 by graham wihlidal in ue5-main branch]
2021-06-09 18:18:00 -04:00
chris kulla
b5b78d8b33 Introduce new RT payload for path tracing shaders
The goal is to simplify the code for path tracing and make room for fields that will be required by future feature additions without impacting the regular RT shaders.

Simplified the packing/unpacking logic a bit since we have more space available in this context.

Remove path tracing specific flags from RT payload and indicate which flags are free for future use

#rb Patrick.Kelly

[CL 16607005 by chris kulla in ue5-main branch]
2021-06-09 12:31:00 -04:00
charles derousiers
fefffd2c70 Move shader draw debug lock data onto the view state.
#rb none


#ROBOMERGE-SOURCE: CL 16606068
#ROBOMERGE-BOT: (v828-16531559)

[CL 16606075 by charles derousiers in ue5-main branch]
2021-06-09 11:32:39 -04:00
krzysztof narkowicz
03fa57d97d Disable DBuffer sampling in ray tracing hit shaders and Lumen surface cache shaders, as DBuffer is not available in those passes
#rb Patrick.Kelly, Jeremy.Moore


#ROBOMERGE-SOURCE: CL 16605484
#ROBOMERGE-BOT: (v828-16531559)

[CL 16605530 by krzysztof narkowicz in ue5-main branch]
2021-06-09 10:58:38 -04:00
luke thatcher
43d14b773b Fix UMaterialExpressionDBufferTexture material node not accounting for dbuffer write mask on supported platforms.
#rb Jeremy.Moore
#preflight 60bfcdcb44f42400011f1c01


#ROBOMERGE-SOURCE: CL 16594593
#ROBOMERGE-BOT: (v828-16531559)

[CL 16594647 by luke thatcher in ue5-main branch]
2021-06-08 17:50:09 -04:00
ola olsson
799374b7a0 Increase limit of instances possible in CullInstances to 16M
#preflight 60be2bd53ba4c30001b03965

#rb rune.stubbe
[FYI] charles.derousiers


#ROBOMERGE-SOURCE: CL 16584147
#ROBOMERGE-BOT: (v828-16531559)

[CL 16584172 by ola olsson in ue5-main branch]
2021-06-08 05:01:40 -04:00
graham wihlidal
67923137a7 More instance data memory and CPU optimizations, and general refactoring.
* Moved Nanite resource ID and hierarchy offset back to primitive data (indirection cost is largely noise these days, and memory savings is more important - GetInstanceData() fetches this data and stores in the pre-existing registers so all the callsites don't have to worry about it).
* Removed FNaniteInfo from FPrimitiveInfo (and the type itself) in favor of just having a 32bit per-instance hierarchy root offset. Hierarchy offset and runtime resource ID just sourced from primitive.
* Removed PrimitiveID from CPU instance data (GPU still needs it). This value was redundantly stored per-instance, and now the GPU Scene upload just blits it over from primitive when the instance data is uploaded.
* Added new virtual GetNaniteResourceInfo on FPrimitiveSceneProxy that retrieves the Nanite resource ID and hierarchy offset stored on a given primitive (needed now that FPrimitiveInstance doesn't cache a copy). The non-virtual FPrimitiveSceneProxy::IsNaniteMesh() helper is used to avoid this virtual function call for non-Nanite proxies.
* Removed deprecated and no longer referenced Nanite::FResources array on FNaniteGeometryCollectionSceneProxy
* Removed expensive per-instance checks() in a few spots
* Stubbed out upcoming per instance payload allocator offset
* Removed deprecated and never referenced non-GPUScene GetInstanceData uniform buffer path
* Significantly cleaned up and optimized a lot of ISM instance data retrieval, including avoiding unnecessary FRenderTransform <-> FMatrix conversions.
* Removed GetInstanceShaderValues API, it was inefficient and annoying to require retrieval of all parameters when often only one or two of them were ever used. In some cases even the origin was unused but .w was needed because of the per-instance random packing.
* Implemented explicit GetInstanceRandomID() accessor to fetch (under current packing) Origin.W without exposing this to the callsites
* Implemented public API for GetInstanceLightMapData(), since the internal version was only accessible by GetInstanceShaderValues()
* Renamed GetInstanceShaderCustomDataValues() -> GetInstanceCustomDataValues() for API consistency

#rb jason.nadro, krzysztof.narkowicz
[FYI] rune.stubbe, brian.karis


#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 16583156
#ROBOMERGE-BOT: (v828-16531559)
#ROBOMERGE-CONFLICT from-shelf

[CL 16583193 by graham wihlidal in ue5-main branch]
2021-06-07 23:55:28 -04:00
Ola Olsson
002e8128ae Basic shader check implementation that (on SM6) just puts the line number in the payload (line/file/text is future work)
- Adds macros check, checkBufferAccess and checkStructuredBufferAccess, along with Slow-suffixed equivalents
 - A new cvar 'r.Shader.CheckLevel' which defaults to 1 (enable check but not Slow). Thus be careful when using check, if unsure use checkSlow!
 - The cvar controls macros DO_CHECK=0 and DO_GUARD_SLOW=0 that mirrow the ones in host code.
 - Note that SM6 version only works for CS and PS.

#rb charles.derousiers
#preflight 60be56fc1e21b4000177f07b

[CL 16576687 by Ola Olsson in ue5-main branch]
2021-06-07 16:16:49 -04:00
Rolando Caloca
3475ca5434 UE5 - Fix Vulkan missing dual blending annotation; move it to be platform agnostic
#fyi Brian.White, Dmitriy.Dyomin
#rb Will.Damon
#jira UE-117253
#rnx

[CL 16574688 by Rolando Caloca in ue5-main branch]
2021-06-07 14:30:42 -04:00
charles derousiers
b402ba8720 Fix vulkan compilation issue with new ShaderPrint coloring.
Vulkan/DXC does not support initialization of static const variable having complex type. This change lines change the initialization to some simple define instead.

#rb none


#ROBOMERGE-SOURCE: CL 16574414
#ROBOMERGE-BOT: (v828-16531559)

[CL 16574416 by charles derousiers in ue5-main branch]
2021-06-07 14:15:34 -04:00
charles derousiers
d5bad3b8b2 Add 64 group size support for hair strands voxelization.
#rb none


#ROBOMERGE-SOURCE: CL 16573024
#ROBOMERGE-BOT: (v828-16531559)

[CL 16573030 by charles derousiers in ue5-main branch]
2021-06-07 13:03:12 -04:00
charles derousiers
0390184ee4 Add color support for shader print.
#rb none
#preflight 60bded2c0249c30001e4eceb


#ROBOMERGE-SOURCE: CL 16568047
#ROBOMERGE-BOT: (v828-16531559)

[CL 16568081 by charles derousiers in ue5-main branch]
2021-06-07 06:25:15 -04:00
charles derousiers
76466fc4e4 Add proper ASCII texture to print standard character set from shader.
#rb none


#ROBOMERGE-SOURCE: CL 16566309
#ROBOMERGE-BOT: (v828-16531559)

[CL 16566349 by charles derousiers in ue5-main branch]
2021-06-06 16:05:31 -04:00
charles derousiers
4379f1095a Clarify ShaderPrint data structure offset.
#rb none


#ROBOMERGE-SOURCE: CL 16566268
#ROBOMERGE-BOT: (v828-16531559)

[CL 16566348 by charles derousiers in ue5-main branch]
2021-06-06 16:05:24 -04:00
charles derousiers
038a696da6 Fix shader draw debug lock.
#rb none


#ROBOMERGE-OWNER: charles.derousiers
#ROBOMERGE-AUTHOR: charles.derousiers
#ROBOMERGE-SOURCE: CL 16566234
#ROBOMERGE-BOT: (v828-16531559)
#ROBOMERGE-CONFLICT from-shelf

[CL 16566334 by charles derousiers in ue5-main branch]
2021-06-06 16:02:30 -04:00
andrew lauritzen
4fd9248b20 Remove dynamic vertex buffer creation/updates from shadow projection
- Whole scene shadows now generate their planes in the VS directly
- Persistent projected frustum geometry VS gets unprojected and reprojected in the VS for per-object and similar cases. This could be done entirely in a VS as well, but since this VS is used for sphere and cone geometry as well it avoids an additional permutation to keep it a (static) VB for now.
- Split unrelated VS's into separate entry points and parameters

#rb zach.bethel


#ROBOMERGE-SOURCE: CL 16555017
#ROBOMERGE-BOT: (v828-16531559)

[CL 16555019 by andrew lauritzen in ue5-main branch]
2021-06-03 19:04:12 -04:00
Sebastien Hillaire
44ad15e40d Clean up of shader parameter from 16546528.
#rb none

[CL 16547171 by Sebastien Hillaire in ue5-main branch]
2021-06-03 10:19:26 -04:00
charles derousiers
4b5e9e7976 * Move INDIRECT_GROUP_COUNT_X code into HairStrandsClusterCommon
* Add helper functions for computing (culled) vertex fetch index.

This insures that vertex index are computed the same way and with the same group count when hair culling is enabled.

#rb none


#ROBOMERGE-SOURCE: CL 16546558
#ROBOMERGE-BOT: (v828-16531559)

[CL 16546605 by charles derousiers in ue5-main branch]
2021-06-03 09:14:52 -04:00
Sebastien Hillaire
e155feef82 Adding tunable noise to volume fog in two places
1. Jitter the offset of the sample position when writing to the light scattering volume texture, controlled with new cvar r.VolumetricFog.LightScatteringSampleJitterMultiplier
2. Per-pixel upsampling noise when reading from the volume texture, controlled with new cvar r.VolumetricFog.UpsampleJitterMultiplier

Occupancy is the same and overhead minimal.

Thanks to The Coalition!
#rb none

[CL 16546528 by Sebastien Hillaire in ue5-main branch]
2021-06-03 09:02:26 -04:00
charles derousiers
a883495a9a Uniformize all hair strands shader group size permutation.
#rb none


#ROBOMERGE-SOURCE: CL 16545319
#ROBOMERGE-BOT: (v828-16531559)

[CL 16545329 by charles derousiers in ue5-main branch]
2021-06-03 06:41:32 -04:00
Ola Olsson
91ed2ab3ba Move instance ID buffer to RDG and out of the View uniform buffer and into own UB.
- Enables overlapping batched and non-batched instance culling (needed for batching work).
 - Removes some explicit transitions & minor cleanup.
 - Added tracking the required number of instances (fixes non-nanite VSM for large ISMs)

#rb graham.wihlidal,jian.ru,yujiang.wang,zach.bethel
#preflight 60b73f38107dc600017d931b

[CL 16544217 by Ola Olsson in ue5-main branch]
2021-06-03 02:19:28 -04:00
krzysztof narkowicz
94e62e8d65 Lumen:
* Bumped min allocated card size to 8x8, but kept culling at 4x4. This increases cache usage by 0.5M, but allows for more efficient capture and processing of cards
* Added r.LumenScene.SurfaceCache.CardMinResolution which controls when card should be distance culled (min res is still clamped to 8x8)

[FYI] Patrick.Kelly, Daniel.Wright


#ROBOMERGE-SOURCE: CL 16539430
#ROBOMERGE-BOT: (v828-16531559)

[CL 16539456 by krzysztof narkowicz in ue5-main branch]
2021-06-02 17:12:28 -04:00
charles derousiers
81119d42d1 Add hair strands lumen occlusion support.
#rb daniel.wright
#jira FROST-138

#ROBOMERGE-SOURCE: CL 16533597 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v828-16531559)

[CL 16533607 by charles derousiers in ue5-main branch]
2021-06-02 09:26:22 -04:00
Sebastien Hillaire
b6b471ac1d Fix for velocity not working on ThinTranslucent shading model.
#jira reported via UDN
#rb Kevin.Ortegren

[CL 16533179 by Sebastien Hillaire in ue5-main branch]
2021-06-02 08:36:32 -04:00
charles derousiers
8c6a059f03 Add ShaderPrintText function for print TEXT("") string within shader.
#rb yuriy.odonnel, sebatien.hillaire
#jira none
#preflight 60b7570fc744b2000146292e

#ROBOMERGE-SOURCE: CL 16531948 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v828-16531559)

[CL 16531979 by charles derousiers in ue5-main branch]
2021-06-02 07:03:05 -04:00