Commit Graph

144 Commits

Author SHA1 Message Date
Tiantian Xie
c280df72de Added experimental support for Burley Normalized Subsurface Scattering.
1. Burley is disabled by default. To preview it, you need to 1) set r.SubsurfaceScattering.Type to 1 and 2) check the enable burley box in the profile.
2. Burley parameters always update from Separable. To disable it, set r.SSS.Burley.AlwaysUpdateParametersFromSeparable to 0.

#rb krzysztof.narkowicz
#jira none

[CL 7289867 by Tiantian Xie in Dev-Rendering branch]
2019-07-12 11:50:25 -04:00
zach bethel
f50bc28c62 Post Process Materials ported to RDG.
#rb Zabir.Hoque
#jira none

[CL 7073468 by zach bethel in Dev-Rendering branch]
2019-06-18 16:58:24 -04:00
Rolando Caloca
83354ba5f6 Merging //UE4/Dev-Main@7063110 to Dev-Rendering (//UE4/Dev-Rendering)
#rb none
#rnx

[CL 7064716 by Rolando Caloca in Dev-Rendering branch]
2019-06-18 13:00:17 -04:00
rolando caloca
83c57c2a0f UE4.23 - Deprecate FUniformBufferRHIParamRef, FIndexBufferRHIParamRef, FVertexBufferRHIParamRef, FStructuredBufferRHIParamRef, FTextureRHIParamRef, FTexture2DRHIParamRef, FTexture2DArrayRHIParamRef, FTexture3DRHIParamRef, FTextureCubeRHIParamRef
#rb none
#jira UE-76364

#ROBOMERGE-SOURCE: CL 7046967 in //UE4/Release-4.23/...
#ROBOMERGE-BOT: RELEASE (Release-4.23 -> Main) (v367-6836689)

[CL 7047009 by rolando caloca in Main branch]
2019-06-17 13:39:07 -04:00
Rolando Caloca
aa0d2303d6 Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) @ 6944469
#rb none
#rnx

[CL 6944849 by Rolando Caloca in Main branch]
2019-06-11 18:27:07 -04:00
Rolando Caloca
a71b641115 DR - Deprecate FSamplerStateRHIParamRef
#rb none

[CL 6595052 by Rolando Caloca in Dev-Rendering branch]
2019-05-21 10:37:48 -04:00
zach bethel
32c641a7d9 Eliminate CachedRHI union and direct casting to FRHIResource**
#jira none
#rb Guillaume.Abadie

[CL 6401673 by zach bethel in Dev-Rendering branch]
2019-05-09 14:20:46 -04:00
Krzysztof Narkowicz
8c41f14e9d Fixed SSS. Intermediate SSS render target needs to be RGBA, as alpha stores depth which is used for the subsuface blur.
#rb Zachary.Bethel
#jira UE-73339

[CL 6112073 by Krzysztof Narkowicz in Dev-Rendering branch]
2019-04-26 15:31:23 -04:00
Rolando Caloca
375d9f4455 DR - Fix CIS warnings
#fyi Zach.Bethel, Guillaume.Abadie
#rb none
#rnx

[CL 6098241 by Rolando Caloca in Dev-Rendering branch]
2019-04-25 15:48:22 -04:00
Guillaume Abadie
742f980e6f Fixes separate translucency fallback that was wrong, and yet unecessarily applied when separate translucency has been disabled.
This changes now explicitly write in code if a input is required using CreateRDGTextureForRequiredInput(), or optional CreateRDGTextureForOptionalInput() or should create a fallback with CreateRDGTextureForInputWithFallback() because still needed something because no permutation without it are existing.

#rb zach.bethel
#fyi juan.canada

[CL 6068769 by Guillaume Abadie in Dev-Rendering branch]
2019-04-23 18:38:43 -04:00
zach bethel
f2155c9f82 Cleanup / Refactor of ScreenPass implementation, and bug fixes.
- Fixed regression with checkerboard rendering and odd render target sizes. The passes were not guaranteed to produce
   a UV coordinate centered on an input pixel for each output pixel.

 - Fixed regression when visualizing SSS at native screen resolution (i.e. no secondary spatial upsampling). The issue was that
  the rendering composition graph injects the backbuffer as the last texture in the post processing pipeline. If visualize SSS was
  the last pass, it would overwrite the backbuffer texture, causing visual artifacts.

 - Minor performance improvement for multi-view SSS. All views in a split-screen scenario now render into the same output target (instead
   of ping ponging between multiple targets) and only views not utilizing SSS get copied from the source target. The is reduces the worst case
   of viewport copied from O(N^2) to O(N); if all viewports use SSS (common in VR), then no copies are performed.

 - Removed FScreenPassTexture in favor of more selective pairing of FRDGTextureRef and FScreenPassTextureViewport. This reduces
   some boilerplate and extraneous memory copying. Motion blur passes now compute their viewport shader parameters once.

#jira UE-72787
#rb Guillaume.Abadie

[CL 6059686 by zach bethel in Dev-Rendering branch]
2019-04-23 13:26:51 -04:00
Yuriy ODonnell
2f6ec94f5a Fixed allocation of temporary FScreenPassContext objects that lead to memory leaks.
FScreenPassContext::Create used to allocate FScreenPassContext objects on FMemStack, however it has a non-trivial destructor which was never called.

Instead of allocating temporary objects on the FMemStack automatically to ensure that they remain alive for the duration of GraphBuilder lifetime, FRDGBuilder::AllocObject() has been added. It explicitly associates the lifetime of allocated temporary object with the specific graph builder.

Correct destructors are automatically called when FRDGBuilder itself is destroyed.

#jira UE-72802
#rb Guillaume.Abadie

[CL 5975133 by Yuriy ODonnell in Dev-Rendering branch]
2019-04-18 05:04:59 -04:00
Lukas Hermanns
deebda3874 Fixed shared samplers in MotionBlur and Subsurface shaders for GL backend.
#rb Rolando.Caloca
#rnx

[CL 5925632 by Lukas Hermanns in Dev-Rendering branch]
2019-04-16 17:12:15 -04:00
zach bethel
51bea3c01b Refactored Screen Pass utilities and Subsurface Scattering Implementation.
- Removed samplers from input struct, since most samplers are shared between inputs.
 - Introduced the FScreenPassTextureParameters struct, describing pixel / UV rect dimension
   used to sample from a region of the texture in HLSL. Centralizes a lot of the common math
   operations currently being done ad-hoc or exposed in PostProcessCommon.ush.

 - Removed FScreenPassInput in favor of a non-shader parameter class called FScreenPassTexture. This
   data structure pairs together the RDG texture and screen pass shader parameters. This allows pass
   inputs to carry important state like which view rect is being used; this provides a more scalable alternative
   to 'SceneColorViewRect' and 'ReferenceBufferSize'.

 - Added an FScreenPassTextureViewportTransform struct that is designed to map UVs from one texture space
   to another. For example, from the upsampled temporal AA UV to velocity UV.

 - Replaced view-specific parameters with screen pass parameters in the subsurface shader.

#rb Guillaume.Abadie
#jira none

[CL 5833674 by zach bethel in Dev-Rendering branch]
2019-04-11 19:32:04 -04:00
Ola Olsson
e3ef53dd71 Clustered deferred shading implementation.
- Added clustered deferred pixel shader & supporting code (using render graph)
- GetSubsufaceProfileTexture_RT now returns non-const pointer to make it work with RegisterExternalTexture
- Added FSortedLightSetSceneInfo to store the sorted lights and ranges, moved light sorting to before light grid injection.
  - Moved light sorting to own function: FDeferredShadingSceneRenderer::GatherAndSortLights
  - Added Simple Lights to the sorted light array.
  - Lights supporting clustered deferred now have their own sub-range (which include rect lights without a source texture)
- Added ranges of light indices to the FForwardLightData such that the shader can skip any lights that are not supported by clustered deferred (but they are there for other operations)
- Added flag to say if the lights were injected in the light grid.
- Added 'DummyRectLightSourceTexture' to FForwardLightData to use as the fallback rect light source texture instead of the clearly invalid DeferredLightData
- Refactored light grid injection to use RenderGraph and more convenient parameter setting.
- Added light type to local light data stored for light grid (2 bits packed into uint used for shadow map channel mask / lighting channel mask)
- Fix for light complexity that was influenced by translucent rendering (in an incorrect way).
- Added "r.DebugLightDiscardProp" / GDebugLightDiscardProp that allows discarding a proportion of the visible lights, to check performance scaling.
- Reorganized tiled deferred shader to reduce register pressure.
- Light grid build:
  - Added view-space light data to speed up light grid build
  - Added slightly improved cone culling test and re-ordererd the tests for better performance.
- Removed dead code: declaration of 'FClusteredLightsSceneInfo'
- Added Preexposure fix (also fixed exposure for light culling visualization)

#rb brian.karis

[CL 5771848 by Ola Olsson in Dev-Rendering branch]
2019-04-06 04:43:26 -04:00
Yuriy ODonnell
2854f05f03 Fixed compile error in some configs due to FRDGEventName construction in ComputeSubsurface()
#rb none

[CL 5683905 by Yuriy ODonnell in Dev-Rendering branch]
2019-04-02 06:32:38 -04:00
zach bethel
d8596faf0e Subsurface scattering post process passes now use new RenderGraph API.
- Cleaned up surrounding code so that subsurface post process code is referenced from one place.
 - Cleaned up shaders to be more consistent and to better support the new parameter struct system.
 - Refactored shaders to use new permutation API and shader parameter APIs.

#jira none
#rb Brian.Karis

[CL 5677263 by zach bethel in Dev-Rendering branch]
2019-04-01 19:37:48 -04:00
Rolando Caloca
932a718f97 DR - Merging //UE4/Dev-Main@5196773 to Dev-Rendering (//UE4/Dev-Rendering)
#rb none
#rnx

[CL 5208164 by Rolando Caloca in Dev-Rendering branch]
2019-02-26 16:43:29 -05:00
marcin undak
915823a4c1 Subsurface scattering fix mostly for Vulkan
#rb Guillaume.Abadie
[FYI] arciel.rekman,rolando.caloca
#jira UE-66557

#ROBOMERGE-SOURCE: CL 5067079 in //UE4/Release-4.22/...
#ROBOMERGE-BOT: RELEASE (Release-4.22 -> Main)

[CL 5067089 by marcin undak in Main branch]
2019-02-19 14:52:59 -05:00
Marcus Wassmer
cbfcbbb93b Merging //UE4/Dev-Main@4662404 to Dev-Rendering (//UE4/Dev-Rendering)
#rb none
Should be just copyright updates

[CL 4680440 by Marcus Wassmer in Dev-Rendering branch]
2019-01-03 19:16:26 -05:00
Ben Marsh
7598af0532 Update copyright notices to 2019.
#rb none
#lockdown Nick.Penwarden

[CL 4662404 by Ben Marsh in Main branch]
2018-12-14 13:41:00 -05:00
Marcus Wassmer
2b944cb943 Copying //UE4/Dev-Rendering@4626416 to Dev-Main (//UE4/Dev-Main)
#rb none
#lockdown nick.penwarden

[CL 4626501 by Marcus Wassmer in Main branch]
2018-12-03 22:25:23 -05:00
Guillaume Abadie
d123ff35c9 Cherry-pick 4529073: Adds support for the visualize texture tool in render graph.
This split the GVisualizeTexture in two:
* first part that capture any texture using a pixel shader, implemented using render pass, that render graph can just automatically insert where needed;
* Second part to present on screem still in Renderer module, because using things like FCanvas, requiring

Depth buffer visualization is broken, because needs to have more functionality in FRDGTextureSRVDesc.

#rb none

[CL 4588745 by Guillaume Abadie in Dev-Rendering branch]
2018-11-21 20:22:47 -05:00
Matt Collins
96be068b75 Render Passes
Self-contained PostProcessing effects.

#jira UERNDR-292
#rb rolando.caloca

[CL 4514307 by Matt Collins in Dev-Rendering branch]
2018-10-26 19:28:13 -04:00
Guillaume Abadie
c72b7a33d8 Merging //UE4/Dev-Rendering-Graph@4492585 to Dev-Rendering (//UE4/Dev-Rendering)
This implements the framework to write the high level rendering code into passes organized in direct acyclic graph. It is also unifying the uniform buffer, shader parameters, and pass parameters to same single API: structures with run time meta data. This allow high level user code be extremely seamless, user code debugging, and render graph ease of implementation and debugging.

Issue of collaborative work of Arne Schnober, Brian Karis, Daniel Wright, Marcus Wassmer and Guillaume Abadie.

Names of the graph managed resources are not final.

#rb Arne.Schnober, Brian.Karis, Daniel.Wright, Marcus.Wassmer

[CL 4492694 by Guillaume Abadie in Dev-Rendering branch]
2018-10-19 17:36:35 -04:00