Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HDRP] Fullscreen subtarget feature #6141

Closed
wants to merge 114 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
397ab27
Initial fullscreen target files
alelievr Sep 16, 2021
b5e9ddf
Added blend modes + depth output option
alelievr Sep 17, 2021
d197e65
Added read mask in stencil descriptor
alelievr Sep 20, 2021
2a70be5
Added Blit support
alelievr Sep 20, 2021
97047c2
Fixed ShaderGraph default shader generator outputing 2 CustomEditor l…
alelievr Sep 21, 2021
50f8621
Added Fullscreen SG material GUI
alelievr Sep 21, 2021
e7ffca3
Add ability to disable stencil and blend in shadergraph (for material)
alelievr Sep 22, 2021
28f538c
refactor to have one sub-target per pipeline + working position compu…
alelievr Sep 23, 2021
5258060
Add URP fullscreen pass implementation
alelievr Sep 24, 2021
a0ab151
Added IsNodeAllowedBySubTarget API
alelievr Sep 29, 2021
851792f
Added node filtering for the fulscreen sub-target + fix scene color n…
alelievr Sep 29, 2021
82cdcfc
Add create callback + separate colorRGBA into color RGB + A
alelievr Sep 29, 2021
18c821a
Move shadergraph fullscreen create menu
alelievr Sep 30, 2021
baf754a
Fix camera color buffer sampling in all HDRP custom pass injection po…
alelievr Sep 30, 2021
da7674d
Added HD scene depth node
alelievr Oct 1, 2021
dbc1e1c
Fix default custom editor in ShaderGraph being only applied if target…
alelievr Oct 1, 2021
648fc95
Fix alpha block by default
alelievr Oct 8, 2021
9b60865
Implemented builtin fullscreen pass (compatible with PPV2)
alelievr Oct 8, 2021
0b0b799
HD Sample depth node now sample the depth instead of loading it
alelievr Oct 8, 2021
57ca8e0
Fixed color LOD sampling
alelievr Oct 11, 2021
f503acd
Use BaseColor instead of Color block
alelievr Oct 11, 2021
4dc9cb7
Add the HD Sample buffer node
alelievr Oct 12, 2021
0b0998f
started to add the draw fullscreen render feature in URP
alelievr Oct 12, 2021
e5abaf6
Fix todo
alelievr Oct 12, 2021
5a8d654
Fix custom post process file creating in HDRP
alelievr Oct 12, 2021
07d459b
Fix render feature debug name + subgraphs in Fullscreen SGs
alelievr Oct 13, 2021
7eb0b01
Added options to bind normal and motion vectors in URP
alelievr Oct 14, 2021
a33cdb7
Normal sampling in Universal sample buffer node
alelievr Oct 14, 2021
cc4314a
Merge remote-tracking branch 'origin/master' into sg/fullscreen-target
alelievr Oct 14, 2021
17997a0
Fix depth test compilation
alelievr Oct 14, 2021
9d002da
Fix custom post process template
alelievr Oct 14, 2021
60a85f6
Started to add GLES2 support + finish URP integration
alelievr Oct 15, 2021
cdb4e33
FIx missing only_renderers
alelievr Oct 18, 2021
bcaadca
Finished fullscreen draw render feature in URP + Fix scene color node…
alelievr Oct 18, 2021
0b7ae6a
Fix rendering pass ignored
alelievr Oct 18, 2021
f893acd
Added sample buffer nodes preview in ShaderGraph
alelievr Oct 18, 2021
8514ef0
Started to add stencil support to custom passes
alelievr Oct 19, 2021
a63c2b3
Finish HDRP stencil integration
alelievr Oct 19, 2021
7e1cbb2
update node preview
alelievr Oct 19, 2021
e563dbd
Fix custom pass UI update
alelievr Oct 19, 2021
a66a418
Fix stencil disabled because of default value
alelievr Oct 20, 2021
e32b9a4
Added HDRP graphic test for fullscreen shader graph
alelievr Oct 20, 2021
aab5e0c
Added custom render texture support
alelievr Oct 20, 2021
a11dd34
Fix wrong stencil keyword generation
alelievr Oct 20, 2021
0dd896a
Fixes
alelievr Oct 20, 2021
8d3cf69
Fix custom pass editor not selecting correctt pass name when a new ma…
alelievr Oct 21, 2021
dd1f6a1
Add simple fullscreen graphic test for ShaderGraph
alelievr Oct 21, 2021
23117c7
Added CRT sub target filter on nodes
alelievr Oct 22, 2021
63247bc
Fix motion vector and blit source in Universal Sample buffer node
alelievr Oct 22, 2021
65c82d9
Add camera color as input
alelievr Oct 22, 2021
16c3af7
Cleanup for HDRP PR
alelievr Oct 26, 2021
4c97c9c
Merge remote-tracking branch 'origin/master' into sg/fullscreen-target
alelievr Oct 26, 2021
f90918b
Fixed HD scene depth node
alelievr Oct 26, 2021
3c13598
Cleanup for HDRP PR
alelievr Oct 26, 2021
a46f349
Merge branch 'sg/fullscreen-target' into hd/fullscreen-subtarget-impl…
alelievr Oct 26, 2021
e404553
Fix lod sampling in custom pass from fullscreen SG
alelievr Oct 26, 2021
857b093
Added depth write / test mode
alelievr Oct 26, 2021
9b033a2
Fix stencil override of objects in HDRP
alelievr Oct 27, 2021
d1ece61
Fix wrong pass index used in fullscreen custom pass
alelievr Oct 27, 2021
8ad492d
Fix fullscreen shader tooltips
alelievr Oct 27, 2021
4eefb04
Fix cubemap sampling in CRT shader, preview texture declaration and r…
alelievr Oct 27, 2021
c11b0a7
Fix lod sampling in custom pass from fullscreen SG
alelievr Oct 26, 2021
f72970e
Fix stencil override of objects in HDRP
alelievr Oct 27, 2021
dac13e0
Fix wrong pass index used in fullscreen custom pass
alelievr Oct 27, 2021
b54a050
Cleanup HDRP side PR
alelievr Oct 27, 2021
1d7186e
Cleanup CRT + add proeprty aliases
alelievr Oct 27, 2021
77c4de7
PR fixes for ShaderGraph
alelievr Oct 27, 2021
033d627
Fix depth mode UX
alelievr Oct 27, 2021
e1fd74b
Cleanup HDRP side PR
alelievr Oct 27, 2021
b53d85f
Added stencil info box in fullscreen pass
alelievr Oct 28, 2021
5545b17
Fix function name conflict in URP sample buffer node
alelievr Oct 28, 2021
88c6d97
Fix function name conflicts in HDRP SG nodes
alelievr Oct 28, 2021
fe05237
Reorder fullscreen SG UI to match the material one
alelievr Oct 28, 2021
8bb7dda
Moved stencil toggle in the correct place
alelievr Oct 28, 2021
cdb8855
Give access to MV for other injection points
alelievr Oct 28, 2021
784d71c
Fixed custom pass UI refresh bug
alelievr Oct 29, 2021
0554c19
Fix mip sampling in custom pass before post process injection point
alelievr Oct 29, 2021
72eb715
Fix scaling issue with HDSceneDepth node
alelievr Oct 29, 2021
dd8da8b
Safe div 0 in FullscreenCommon SG
alelievr Oct 29, 2021
7e5a42a
Fixed default blend mode in shadergraph
alelievr Oct 29, 2021
c4ca41a
Fixed clipping issue due to safe divide
alelievr Oct 29, 2021
2d7d0fd
Fix infinite import loop with ShaderGraphs that don't have an HDMetaD…
alelievr Oct 29, 2021
d669e91
Added Builtin Fullscreen SG test
alelievr Oct 29, 2021
fba52e4
Added stencil info box in fullscreen pass
alelievr Oct 28, 2021
65346d0
Fix function name conflicts in HDRP SG nodes
alelievr Oct 28, 2021
4c8e22f
Give access to MV for other injection points
alelievr Oct 28, 2021
0d78908
Fixed custom pass UI refresh bug
alelievr Oct 29, 2021
3f3d275
Fix mip sampling in custom pass before post process injection point
alelievr Oct 29, 2021
899c40f
Fix scaling issue with HDSceneDepth node
alelievr Oct 29, 2021
b4904a3
Fix infinite import loop with ShaderGraphs that don't have an HDMetaD…
alelievr Oct 29, 2021
cf7b6ea
Fix custom pass stencil message displayed when target depth buffer is…
alelievr Nov 2, 2021
34b1dc2
Remove GLES 2 support + fix DX12 API
alelievr Nov 2, 2021
1a38bc6
Removed BakedGINode for Fullscreen target
alelievr Nov 2, 2021
75b5357
Added reference images for Fullscreen SG
alelievr Nov 2, 2021
1bcb216
Added reference images for HDRP tests
alelievr Nov 2, 2021
ea3a457
Removed BlitSource input in the HDSampleBuffer node + fix codegen for…
alelievr Nov 3, 2021
1034364
Remove is main texture on 2D array
alelievr Nov 3, 2021
e2115fa
Fix custom pass stencil message displayed when target depth buffer is…
alelievr Nov 2, 2021
d9faa93
Removed BakedGINode for Fullscreen target
alelievr Nov 2, 2021
713191c
Added reference images for HDRP tests
alelievr Nov 2, 2021
131362e
Removed BlitSource input in the HDSampleBuffer node + fix codegen for…
alelievr Nov 3, 2021
42b3523
Fix fullscreen SG on builtin
alelievr Nov 3, 2021
0a3c91e
Fix active blocks in builtin target
alelievr Nov 3, 2021
614d793
Fix CRT node issues
alelievr Nov 3, 2021
983953a
Added HDRP what's new
alelievr Nov 3, 2021
f183774
Merge remote-tracking branch 'origin/master' into sg/fullscreen-target
alelievr Nov 3, 2021
d24d76f
Merge branch 'master' into hd/fullscreen-subtarget-implementation
alelievr Nov 4, 2021
48df35b
HDRP PR fixes
alelievr Nov 4, 2021
1a184ff
revert motion vector buffer in custom passes
alelievr Nov 4, 2021
734d68c
HDRP PR fixes
alelievr Nov 4, 2021
9fbc658
Added IsSky function
alelievr Nov 4, 2021
68fb8b9
Merge branch 'sg/fullscreen-target' into hd/fullscreen-subtarget-impl…
alelievr Nov 4, 2021
2fa8c45
Merge branch 'master' into hd/fullscreen-subtarget-implementation
alelievr Nov 4, 2021
c8522e4
Remove SG project from HDRP PR
alelievr Nov 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cleanup CRT + add proeprty aliases
  • Loading branch information
alelievr committed Oct 27, 2021
commit 1d7186e0fe85b683f69ad510eac8f4561dead0ac
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ float CustomRenderTexturePrimitiveIDs[kCustomTextureBatchSize];
float4 CustomRenderTextureParameters;
#define CustomRenderTextureUpdateSpace CustomRenderTextureParameters.x // Normalized(0)/PixelSpace(1)
#define CustomRenderTexture3DTexcoordW CustomRenderTextureParameters.y
#define CustomRenderTextureIs3D CustomRenderTextureParameters.z == CRT_DIMENSION_3D
#define CustomRenderTextureIs3D (CustomRenderTextureParameters.z == CRT_DIMENSION_3D)
#define CustomRenderTextureDimension CustomRenderTextureParameters.z

// User facing uniform variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,50 +169,4 @@ public void GenerateNodeFunction(FunctionRegistry registry, GenerationMode gener
}
}
}

[Title("Custom Render Texture", "Current Dimension")]
[SubTargetFilter(typeof(CustomTextureSubTarget))]

class CustomTextureDimension : AbstractMaterialNode, IGeneratesBodyCode
{
private const string kOutputSlot2D = "Is 2D";
private const string kOutputSlot3D = "Is 3D";
private const string kOutputSlotCube = "Is Cube";

public const int kOutputSlot2DId = 0;
public const int kOutputSlot3DId = 1;
public const int kOutputSlotCubeId = 2;

public CustomTextureDimension()
{
name = "Custom Render Texture Dimension";
UpdateNodeAfterDeserialization();
}

protected int[] validSlots => new[] { kOutputSlot2DId, kOutputSlot3DId, kOutputSlotCubeId };

public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new BooleanMaterialSlot(kOutputSlot2DId, kOutputSlot2D, kOutputSlot2D, SlotType.Output, false));
AddSlot(new BooleanMaterialSlot(kOutputSlot3DId, kOutputSlot3D, kOutputSlot3D, SlotType.Output, false));
AddSlot(new BooleanMaterialSlot(kOutputSlotCubeId, kOutputSlotCube, kOutputSlotCube, SlotType.Output, false));
RemoveSlotsNameNotMatching(validSlots);
}

public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMode)
{
if (generationMode.IsPreview())
{
sb.AppendLine(@"bool {0} = false;", GetVariableNameForSlot(kOutputSlot2DId));
sb.AppendLine(@"bool {0} = false;", GetVariableNameForSlot(kOutputSlot3DId));
sb.AppendLine(@"bool {0} = false;", GetVariableNameForSlot(kOutputSlotCubeId));
}
else
{
sb.AppendLine(@"bool {0} = CustomRenderTextureDimension == CRT_DIMENSION_2D;", GetVariableNameForSlot(kOutputSlot2DId));
sb.AppendLine(@"bool {0} = CustomRenderTextureDimension == CRT_DIMENSION_3D;", GetVariableNameForSlot(kOutputSlot3DId));
sb.AppendLine(@"bool {0} = CustomRenderTextureDimension == CRT_DIMENSION_CUBE;", GetVariableNameForSlot(kOutputSlotCubeId));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ Pass

// ShaderGraph accessors:
float3 WorldSpaceViewDirection;
float3 ObjectSpaceViewDirection;
float3 ObjectSpacePosition;
float3 TimeParameters;
float3 WorldSpaceNormal;
float3 ObjectSpaceNormal;
float2 NDCPosition;
float4 ScreenPosition;
};
Expand All @@ -61,11 +64,44 @@ Pass

// other space of view direction are not supported
$SurfaceDescriptionInputs.WorldSpaceViewDirection: o.WorldSpaceViewDirection = o.direction;
$SurfaceDescriptionInputs.ObjectSpaceViewDirection: o.ObjectSpaceViewDirection = o.direction;
$SurfaceDescriptionInputs.ObjectSpacePosition: o.ObjectSpacePosition = o.direction;
$SurfaceDescriptionInputs.TimeParameters: o.TimeParameters = float3(_Time.y, _SinTime.x, _CosTime.y);
$SurfaceDescriptionInputs.WorldSpaceNormal: o.WorldSpaceNormal = o.direction;
$SurfaceDescriptionInputs.ObjectSpaceNormal o.ObjectSpaceNormal = o.direction;
$SurfaceDescriptionInputs.NDCPosition: o.NDCPosition = o.uv0.xy;
$SurfaceDescriptionInputs.ScreenPosition: o.ScreenPosition = float4(o.uv0.xy, 0, 1);

// Unsupported properties:
$SurfaceDescriptionInputs.WorldSpaceBiTangent: #error 'WorldSpaceBiTangent' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.ViewSpaceNormal: #error 'ViewSpaceNormal' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.TangentSpaceNormal: #error 'TangentSpaceNormal' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.WorldSpaceTangent: #error 'WorldSpaceTangent' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.WorldSpaceBiTangent: #error 'WorldSpaceBiTangent' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.ObjectSpaceTangent: #error 'ObjectSpaceTangent' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.ViewSpaceTangent: #error 'ViewSpaceTangent' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.TangentSpaceTangent: #error 'TangentSpaceTangent' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.ObjectSpaceBiTangent: #error 'ObjectSpaceBiTangent' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.ViewSpaceBiTangent: #error 'ViewSpaceBiTangent' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.TangentSpaceBiTangent: #error 'TangentSpaceBiTangent' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.ViewSpaceViewDirection: #error 'ViewSpaceViewDirection' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.TangentSpaceViewDirection: #error 'TangentSpaceViewDirection' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.ViewSpacePosition: #error ViewSpacePosition'' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.TangentSpacePosition: #error 'TangentSpacePosition' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.WorldSpacePositionPredisplacement: #error 'WorldSpacePositionPredisplacement' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.ObjectSpacePositionPredisplacement: #error 'ObjectSpacePositionPredisplacement' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.ViewSpacePositionPredisplacement: #error 'ViewSpacePositionPredisplacement' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.TangentSpacePositionPredisplacement: #error 'TangentSpacePositionPredisplacement' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.AbsoluteWorldSpacePositionPredisplacement: #error 'AbsoluteWorldSpacePositionPredisplacement' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.uv2: #error 'uv2' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.uv3: #error 'uv3' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.VertexColor: #error 'VertexColor' is not available in Custom Render Textures.

// We can't fake the positions because we can't differentiate Cube and 2D custom render textures
$SurfaceDescriptionInputs.WorldSpacePosition: #error 'WorldSpacePosition' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.ObjectSpacePosition: #error 'ObjectSpacePosition' is not available in Custom Render Textures.
$SurfaceDescriptionInputs.AbsoluteWorldSpacePosition: #error 'AbsoluteWorldSpacePosition' is not available in Custom Render Textures.

return o;
}

Expand Down