1/3/2023 0 Comments Unity 2019 urp shadow caster![]() ![]() When empty this render pass will render to the active camera render target. Also to create temporary render target textures. It can be used to configure render targets and their clear state. This method is called before executing the render pass. Public void Setup(RenderTargetHandle destination) M_FilteringSettings = new FilteringSettings(renderQueueRange, layerMask) Public DepthNormalsPass(RenderQueueRange renderQueueRange, LayerMask layerMask, Material material) ShaderTagId m_ShaderTagId = new ShaderTagId("DepthOnly") Private FilteringSettings m_FilteringSettings Private Material depthNormalsMaterial = null } : /storage/temp/157603-how-i-put-everything.pngĬode of the script to calculate the depthnormal texture DepthNormalsFeature.cs: public class DepthNormalsFeature : ScriptableRendererFeatureĬlass DepthNormalsPass : ScriptableRenderPass UvSamples = UV + float2(-_CameraDepthTexture_TexelSize.x * halfScaleFloor, _CameraDepthTexture_TexelSize.y * halfScaleCeil) įor(int i = 0 i depthThreshold ? 1 : 0 įloat3 normalFiniteDifference0 = normalSamples - normalSamples įloat3 normalFiniteDifference1 = normalSamples - normalSamples įloat edgeNormal = sqrt(dot(normalFiniteDifference0, normalFiniteDifference0) + dot(normalFiniteDifference1, normalFiniteDifference1)) ĮdgeNormal = edgeNormal > (1/NormalsSensitivity) ? 1 : 0 UvSamples = UV + float2(_CameraDepthTexture_TexelSize.x * halfScaleCeil, -_CameraDepthTexture_TexelSize.y * halfScaleFloor) ![]() UvSamples = UV + float2(_CameraDepthTexture_TexelSize.x, _CameraDepthTexture_TexelSize.y) * halfScaleCeil UvSamples = UV - float2(_CameraDepthTexture_TexelSize.x, _CameraDepthTexture_TexelSize.y) * halfScaleFloor Void Outline_float(float2 UV, float OutlineThickness, float DepthSensitivity, float NormalsSensitivity, out float Out)įloat halfScaleFloor = floor(OutlineThickness * 0.5) įloat halfScaleCeil = ceil(OutlineThickness * 0.5) SAMPLER(sampler_CameraDepthNormalsTexture) įloat3 nn = enc.xyz*float3(2*kScale,2*kScale,0) + float3(-kScale,-kScale,1) So far this is what I have from that tutorial: Shader Graph made for the outline in order to have only one object outlined Picture of how I created the the renderer asset !Ĭode of the Outline.sl TEXTURE2D(_CameraDepthTexture) This tutorial but I didn't work for me - Īnd this one -, that I actually think could work but for strange reason give me strange results maybe because I didn't make it right. ![]() I would like to create a 3D outline for my VR application using URP with UNity 2019.3.4f1 but I don't have any idea of how to make it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |