Commit Graph

51 Commits

Author SHA1 Message Date
MarcusSvensson92
f83c3303da PR #12280: Exclude VT samples that don't generate feedback when counting requests
#jira UE-222803

[CL 36427282 by MarcusSvensson92 in 5.5 branch]
2024-09-19 07:58:07 -04:00
jeremy moore
b792767a42 Add missing use case for sampling virtual texture page table.
SampleGrad with single page table and no feedback.
#rnx
#rb Jason.Nadro

[CL 35403327 by jeremy moore in ue5-main branch]
2024-08-08 14:48:06 -04:00
jeremy moore
5c1805c065 Modify virtual texture sampling shader code to branch on virtual texture page table uniform validity before doing work.
Invalid page table uniforms will skip work and the physical sample will return the virtual texture fallback color.
This is done to handle case where page table uniform comes from GPU Scene descriptor and it's valid that a primitive can use the null descriptor.
#rb Jon.Cain

[CL 34993865 by jeremy moore in ue5-main branch]
2024-07-22 14:30:23 -04:00
jeremy moore
497da0a989 Add a material expression to access the mesh paint texture descriptor from a primitive and coerce it to a new mesh paint virtual texture type that can be sampled with a standard texture sample node.
#rb massimo.tristano

[CL 34583597 by jeremy moore in ue5-main branch]
2024-06-21 21:06:39 -04:00
daniele vettorel
649b95addd Workaround for Nvidia 700 series suspected compiler bug (DX11).
The flattened branch seems to result in corrupted texture samples. A proper branch works around the issue.

#jira FORT-715682, UE-211775

#rb mihnea.balta

[CL 32797715 by daniele vettorel in ue5-main branch]
2024-04-08 13:27:17 -04:00
rune stubbe
cb8b590d6a Tessellation optimizations
-Never do early z test for tessellation. Per-pixel masking/pdo isn't even supported there.
-Force VT to use bilinear sampling instread of stochastic trilinear.

#rb jamie.hayes
[FYI] brian.karis, graham.wihlidal
#jira UE-197833

[CL 31564049 by rune stubbe in ue5-main branch]
2024-02-16 09:54:15 -05:00
wouter dek
8f310241b2 Use DoubleFloat instead of tile+offset in various systems on GPU to improve numerical precision.
#jira UE-171685
#rb Charles.deRousiers, tim.doerries

[CL 30763421 by wouter dek in ue5-main branch]
2024-01-21 21:02:35 -05:00
wouter dek
5bb20ed04a Add a translated world space options to several material expressions
#rb kevin.ortegren, jon.cain, massimo.tristano
#jira UE-171685

[CL 29508054 by wouter dek in ue5-main branch]
2023-11-06 20:11:55 -05:00
jeremy moore
3686df28ad #jira UE-178701
Support virtual texture feedback behind a single layer water material.
We need to stochastically drop some writes to the feedback buffer so that we don't overwrite all of the content from the surface beneath.
#preflight 64053f968832f48a4d70c685

[CL 24519404 by jeremy moore in ue5-main branch]
2023-03-06 04:20:27 -05:00
Dmitriy Dyomin
846618cca9 Change VT feedback to use StructuredBuffer instead of texel buffer, to avoid limitations on Apple A9 and A10 GPUs which can't write to texel buffers from a fragment shaders
#jira none
#rb jeremy.moore
#preflight 63e3abfcc11233cdcac92c9a

[CL 24072062 by Dmitriy Dyomin in ue5-main branch]
2023-02-08 09:27:57 -05:00
Dmitriy Dyomin
61048a527c Added manual VT filtering for mobile platforms that do not use TAA (contributed by albin.bernhardsson at ARM)
#jira UE-121358
#rb jeremy.moore
#preflight 63d39b78d21dbe1d290c49b4

[CL 23902542 by Dmitriy Dyomin in ue5-main branch]
2023-01-29 23:03:58 -05:00
rune stubbe
40921839a9 Analytic derivatives support for VirtualTextureWorldToUV and TransformBase
Moved FLWCScalarDerivX to LargeWorldCoordinates.ush

#rb graham.wihlidal
[FYI] brian.karis, jamie.hayes
#preflight 63302ee22c7bc831f89e4259

[CL 22203078 by rune stubbe in ue5-main branch]
2022-09-27 06:58:06 -04:00
Jeremy Moore
110b53ec48 #jira UE-161869
Use fixed stochastic alpha value for writing VT feedback when doing ThinTranslucency.
#preflight 63064480a45b007ea2aa4fe5

[CL 21542089 by Jeremy Moore in ue5-main branch]
2022-08-24 11:48:58 -04:00
aleksander netzel
6ca369dd82 Fix GPU crash when ray tracing debug view is enabled:
* Crash was caused by shader compiler generating invalid code for TextureVirtualSample on some platforms.
* Slightly modified the code as a workaround until the compiler issue is resolved.

#rb Jeremy.Moore
#preflight 6283aabc114e08fa2f1d68a4

[CL 20258456 by aleksander netzel in ue5-main branch]
2022-05-18 05:10:13 -04:00
rune stubbe
a5545b4ad2 Shadercompile fix for Nanite + lightmap VT path
Added new TextureLoadVirtualPageTableGrad overload variation that takes two page tables and doesn't do feedback
#jira UE-140602
#preflight 61f75b3cd07695194bf6c38c
[FYI] ben.ingram

#ROBOMERGE-AUTHOR: rune.stubbe
#ROBOMERGE-SOURCE: CL 18788065 in //UE5/Release-5.0/... via CL 18788098 via CL 18788140
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18788143 by rune stubbe in ue5-main branch]
2022-01-31 06:40:51 -05:00
jeremy moore
3789ffb4a4 #jira UE-140172
LWCify the RVT WorldToUV calculation.
Note that Niagara RVT data provider will continue with non LWC behavior and still needs converting.
[FYI] michael.galetzka
#prefligh 61f40fecf628752a568b8917

#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 18772224 in //UE5/Release-5.0/... via CL 18772235 via CL 18772336
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18772350 by jeremy moore in ue5-main branch]
2022-01-28 11:25:35 -05:00
jeremy moore
9a1d97f4b7 #jira UE-135165
Fix shader compilation error for strict compliers.

#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 18223323 via CL 18372189 via CL 18372296
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18372343 by jeremy moore in ue5-release-engine-test branch]
2021-12-03 15:37:09 -05:00
jon nabozny
6ba99692f9 When sampling VT use a fallback color held in a uniform if the root page isn't mapped.
#rb ben.ingram
#preflight 6175b24d875c1a0001aed3e4
#lockdown michal.valient

#ROBOMERGE-OWNER: jon.nabozny
#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 17904945 via CL 18006803 via CL 18370387 via CL 18370436
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18370510 by jon nabozny in ue5-release-engine-test branch]
2021-12-03 13:43:10 -05:00
jon nabozny
5342ad925e Added VirtualTexturePendingMips debug view mode.
For each pixel it shows the worst case missing mip level in all of the virtual textures sampled at that pixel.
Useful to analyze where late virtual texture page streaming is happening.
#rb ben.ingram
#preflight 615b5ecb255462000117288c
#lockdown michal.valient

#ROBOMERGE-OWNER: jon.nabozny
#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 17716764 via CL 17979410 via CL 18366649 via CL 18366731
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18366789 by jon nabozny in ue5-release-engine-test branch]
2021-12-03 02:44:01 -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
jeremy moore
daefcfead4 Make "r.vt.FeedbackFactor" something that can be changed at runtime, instead of needing a restart/shader recompile.
This should be useful if we want to vary the feedback trade offs for different modes.
Did some comparisons of shader ISA and ALU cost is unchanged.
#jira none
#ushell-cherrypick of 17483512 by Jeremy.Moore

#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 17491509 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17491521 by jeremy moore in ue5-release-engine-test branch]
2021-09-13 09:57:32 -04:00
jeremy moore
f636e11e75 Fix VT feedback in the case where we read DBuffer directly in material instead of through the material decal response.
Previously any DBuffer feedback would be overwritten in the base pass.
#rb none
#preflight 6107efcdbc7e43000133e5f5

#ROBOMERGE-SOURCE: CL 17015479 via CL 17015481
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v839-17012307)

[CL 17015484 by jeremy moore in ue5-release-engine-test branch]
2021-08-02 09:39:42 -04:00
yangke li
5fb9374d13 Add a Mobile friendly RVT MaterialType BaseColor_Normal_Roughness with basecolor in RT0, NormalXY and roughness in RT1, NormalZ is considered always a positive number( which is the situation for local space normal)
Add A  flag bUseLowQualityCompression to BaseColor_Normal_Roughness, which fakes compression by 16bit format(RGB565)

#rb Dmitriy.Dyomin

#ROBOMERGE-SOURCE: CL 16977982 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v838-16927207)

[CL 16977984 by yangke li in ue5-release-engine-test branch]
2021-07-27 22:07:02 -04:00
jeremy moore
eb7ddc075d Fix for virtual texture sampling reading unbound View uniform buffer in texture editor.
#ROBOMERGE-SOURCE: CL 16731901 via CL 16731904
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16731913 by jeremy moore in ue5-release-engine-test branch]
2021-06-21 15:20:42 -04:00
jeremy moore
7124ab4a00 #jira UE-117953
#jira UE-109349
Add mip map bias for virtual texture sampling.
Respects the existing r.MiipMapLodBias CVar.
Also add residency tracking for each virtual texture physical pool.
If the pool has been created from a config with the bEnableResidencyMipMapBias flag set then a mip map lod bias is applied to bring the pool back within budget.
The residency mip map lod bias is applied globally (combined with the global mip map lod bias).
In future it could be good to apply the mip map lod bias per physical pool, but this will require tracking all physical pool combinations for each page table.
Physical pool residency tracking can be shown on screen with r.vt.residency.show CVar.
#rb ben.ingram

#ROBOMERGE-SOURCE: CL 16724483 via CL 16724487
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16724488 by jeremy moore in ue5-release-engine-test branch]
2021-06-20 18:47:26 -04:00