Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

[Released] Lux URP Essentials

Discussion in 'Assets and Asset Store' started by larsbertram1, Jul 18, 2019.

?

Does Lux URP Essentials need a Discord Server?

Poll closed Apr 29, 2021.
  1. yes - even if there was no moderator

    4 vote(s)
    57.1%
  2. no, the forum is all we need

    3 vote(s)
    42.9%
  1. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    that won't happen in the next weeks, sorry. 12.1. is the version which is supported.
    but nevertheless: can you give some more information about the errors?
     
  2. BurkhardK

    BurkhardK

    Joined:
    Jun 2, 2019
    Posts:
    7
    here a screenshot with some of them (directly after importing LUX Essentials):

    upload_2022-4-23_23-18-39.png
     
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    great: they did i once more! thank you unity!
     
  4. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    i grabbed unity 2021.3.1f1 und created a new project with urp 12.1.6. then i imported lux urp essentials 1.85:
    no error. just a few warnings.
    so i guess that you do not have version 1.85. unity is very picky and may just do not update the package unless you go to the asset store cache folder and delete previous downloads: C:\Users\accountName\AppData\Roaming\Unity\Asset Store

    warnings.PNG
     
  5. swantonb

    swantonb

    Joined:
    Apr 10, 2018
    Posts:
    172
    Hi there, I'm wondering about performance of those shaders. I'm trying to replace the Lit shader with a shadergraph from you, not sure if any of you shaders is a 1:1 replica. But probably there is one. I want to use it with virtual textures and it needs to be a shader graph. So my questions are, is there a good replica for URP/Lit shader in this package? And if yes, is it at least as performant as URP/Lit?
     
  6. BurkhardK

    BurkhardK

    Joined:
    Jun 2, 2019
    Posts:
    7
    I dont now what did the trick, I allready deleted all folders except "Assets" and "Project Settings" and recreated my project twice last week. I started with version 1.85 because I bought it 2 weeks ago. Anyway now the Terrain shaders is compiling without any errors. I guess it was really something in my cache, maybe in my urp installation.

    Thanks for your support larsbertram1
     
    Last edited: Apr 26, 2022
  7. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    the is no shader graph replica in the package and if so it would most likely not be as performant as urp/lit as shader graph usually creates rather fat vertex data. on the other hand UPR/Lit does not use the best texture layout and you can easily outperform it by using better packing.
     
  8. swantonb

    swantonb

    Joined:
    Apr 10, 2018
    Posts:
    172
    I see. Well if you ever get bored and want to replicate the URP's default shaders (mostly Lit and simple lit i guess) to shadergraph I'm sure they would be wanted because that's the only way to get VT to work
     
  9. Kalisto

    Kalisto

    Joined:
    Dec 8, 2014
    Posts:
    3
    Do any of the shaders support Deferred Rendering Path in URP?
     
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    custom lighting shaders like skin, hair and cloth or transparent shaders like water will always be forward but they play well with deferred.
    grass and foliage are deferred with different approximations for the translucent lighting part.
    shaders which do not implement custom lighting work in deferred and forward.
     
  11. Kalisto

    Kalisto

    Joined:
    Dec 8, 2014
    Posts:
    3
    Ahh i was trying to see if the toon shader worked with deferred specifically. :(
     
  12. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    you can use it along with deferred rendering - but it will be rendered using forward.
     
  13. Jess_AA

    Jess_AA

    Joined:
    May 8, 2019
    Posts:
    38
    Hi, I've noticed an interesting issue with the Lux Clear Coat shader. When the asset moves through a shadow cascade threshold, I get what looks like artifacting in the normal map? The image is the car door, sorry I can't share much more as it's client work!
     

    Attached Files:

  14. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    and this is related to the shader? not the geometry?
     
  15. Jess_AA

    Jess_AA

    Joined:
    May 8, 2019
    Posts:
    38
    Yes, it only happens when the asset has the lux clear coat shader applied to it.
     
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    hmm, could not reproduce it. maybe you can provide a simple test scene.
    looking into the code: these artifacts should either be caused by the shadow caster pass or the claculating the shadowcoords during the lighting. in both cases lux urp 1.85.1 for urp 12 uses "official" code.
     
  17. Jesper-Nielsen

    Jesper-Nielsen

    Joined:
    Nov 14, 2013
    Posts:
    95
    I misused your water shader a bit :) I've had a lot of trouble making cave entrances properly dark. No normal map, 0 smoothness, black fog.
    Could probably use a much simpler shader for the same result, or perhaps bake AO for the scene. But this looks exactly how I want it.

    upload_2022-5-27_22-4-52.png
     
  18. flissule

    flissule

    Joined:
    Aug 23, 2013
    Posts:
    6
    Hi! I'm having trouble using the decal stencil mask in unity using the URP deferred renderer. I managed to set it up in forward but as I understand stencil works differently in deferred rendering... Do you have any tips? Should the Stencil override in my renderer data be active?
     

    Attached Files:

  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    looking into stencils and deferred rendering a while ago i could not make them work: urp just overrides the settings from the material...
    one thing you could try to exclude certain objects from receiving decals:
    set the material to transparent.
    this will make it being rendered in the forward transparent pass on top of the deferred passes (using the forward opaque pass URP still would override the stencil settings).
    this of course is not the full solution as a) you will get forward lighting and b) the object does not write to the camera's depth texture.

    solution
    use 2 materials: one regular material, then add a 2nd one on top which only writes to the stencil buffer using the transparent render queue so we can actually set the stencil values.

    possible outcome
    scene view uses forward rendering, so all stencil settings work as expected: white plane and green cube exclude the decal.
    game view uses deferred. here all stencil settings are overridden. however the green box still gets properly occluded from the decal as it uses 2 materials: Lux_URP_Stencil_Only just writes to the stencil buffer using the transparent-1 render queue.

    outcome.PNG

    it also works the other way around. here the decal needs 1 to be written to the stencil buffer. again in scene view all materials just work. in game view only the green cube using the extra material works properly.

    outcome1.PNG

    simple shader
    attached
     

    Attached Files:

  20. flissule

    flissule

    Joined:
    Aug 23, 2013
    Posts:
    6
    Wow, interesting solution, looks promising. I'll try it out as soon as I can and let you know how it works!
    Thanks a lot ;)
    François
     
  21. Weezel

    Weezel

    Joined:
    Apr 20, 2013
    Posts:
    25
    Hi, I'm wondering about the performance of the decal shaders. How many decals you could have in a scene before seeing a performance loss? I would like to possibly use up to a few hundred at once. The URP decal shader has an option for GPU instancing. Does yours have something like that also?
     
  22. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    it should support instancing. but if checked the old built in render pipeline system will kick in and render them (instead of the srp batcher). this might be even slower.
    so best would be to draw them instanced by script using culling groups e.g.
     
  23. Slashbot64

    Slashbot64

    Joined:
    Jun 15, 2020
    Posts:
    335
  24. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    semi transparent, dithered shadows ar kind of a nightmare, visually. so i do not think that i will ever work on these. sorry.
     
  25. Slashbot64

    Slashbot64

    Joined:
    Jun 15, 2020
    Posts:
    335
    They aren't dithered looking at all with built in though... and it's alot better than looking at an object with a material like glass yet it's casting a full hard shadow behind it with no relation to the transparent/opacity of the material the light is coming through (not asking for color translucency or path tracing levels of realism here).. it just seems like a really basic thing to have for any game engine renderer in 2022.. currently URP just looks like a joke that has been really cut back on features that were in built in... seems backwards but then it is URP issue with Unity that seems to be regressing in just about everything.
     
  26. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    they are dithered. and how bad it looks depends on a lot of factors.
     
  27. Slashbot64

    Slashbot64

    Joined:
    Jun 15, 2020
    Posts:
    335
    Well with 'hard and soft shadows' on, the dithered look doesn't show at all as it is smoothed over.. no sign of dithering.. obviously without soft shadows and low quality shadow resolution they look bad.. I'd rather have smooth dithered shadows for an objects that aren't opaque than hard shadows or none at all..

    What about this...
     
  28. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I've run into a problem, and I hope someone can help. I am using the Decal Unlit shader and the standard decal prefab from URP Essentials (latest version from Asset Store as of today) to project satellite images onto terrain. Because the terrain is tiled, I had to create multiple copies of the URP Essentials unlit decal material, but the only change I am making from the default is to assign each one the correct (and unique) albedo map. The shader settings are the same for all.

    This was working perfectly until recently, and I think the problem is due to having upgraded the URP package from 12.x to 13.x (I didn't realize URP Essentials doesn't yet support 13.x). Fortunately, my builds still work correctly, and in fact everything is fine in the editor until you select any object related to the decals. After that, it's broken until the next restart of the editor.

    The symptoms are that the decals render with their UV coordinates mapped incorrectly, producing a strange refraction-like distortion.

    Here are some screen shots of the correct behavior, the problem behavior, and my settings. All of these are from the same scene, same project, and same versions of everything (IOW, the working screen shots are not from the previous version before the problem occurred -- they are from today, just like the broken ones).

    I spent a lot of time in the documentation (which, btw, is quite good), and at first, I thought the issue might be not having depth texture enabled in the URP settings. But I checked that, and it's definitely enabled, as is the opaque texture.

    This behavior replicates in the URP Essentials decal sample scene, with no alterations to that scene.

    There are no errors in the console for my settings, but if I attempt to use the HQ Sampling option, there is an error taht identifier DepthX is not defined at (if I recall) line 486 in the shader.

    Thanks for any help that can be offered. I have a project deadline of July 29 and would like to get this cleared up before my final build to show the client, but since the built version is working despite the in-editor issues, I am probably okay. I'd like to avoid backtracking the Unity and URP versions if I can, because that's likely to get messy.

    Screen shots follow.

    Working:
    LUX-URP-Decal-URP13_1-ProjBug00.png LUX-URP-Decal-URP13_1-ProjBug03.png

    Broken:
    LUX-URP-Decal-URP13_1-ProjBug01.png LUX-URP-Decal-URP13_1-ProjBug02.png

    Settings:
    LUX-URP-Decal-URP13_1-ProjBug04.png
     
  29. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    you should not use decals for this but sample the images directly in the terrain shader: 100 times faster :)
     
    syscrusher likes this.
  30. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I agree, in general. The purpose of the decal mode is to allow the overlay to be dynamic. There are also other decals that I want to use that aren't directly mapped to world coordinates as the UV on the satellite data is, so I was hoping to get the feature "proved out" with this part and then replicate it for the other use-cases.
     
  31. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    it is never a great idea to use decals with such huge volume. just compare it to what the terrain actually covers.
    decals might be handy here. but they are very expensive compared to a proper solution.
     
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    i had a quick look into urp 13 and it looks that for some unknown reason _CameraDepthTexture_TexelSize.zw does not work as expected.
    simply replace it with _ScaledScreenParams.xy
     
    Last edited: Jul 28, 2022
    syscrusher likes this.
  33. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Understood. I re-implemented my solution with a full-custom shader that can do the overlays plus the other features I needed, so I'm good to go. I found that the decals still malfunction even when they're small, as in your example scene, so that may be something you need to look at for Unity version compatibility. But the immediate need for my project is solved.
     
  34. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Awesome! Notwithstanding my previous comment, I'd still like to use the decal feature (smaller instances) elsewhere, so I'll give this a try and let you know if it works. Thanks!
     
  35. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    Hi, your Glass shader fails to compile in URP 13. Is this a known issue?

    Unity_OmnelZVRoj.png
     
  36. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    yes. urp 13 is not supported yet. might come soon however.
     
  37. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    btw. lux urp essentials already offers dithered shadows. if you loo into the uber demo and look at the lod transition or camera fade.
     
  38. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    I did find an updated URP glass shader on Github, but it's no good. Your glass shader is literally the only working URP glass shader, please do update it.
     
  39. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    may take a few days.
    if you need it now you will have to edit the shader manually.
    find:
    #define _ALPHAPREMULTIPLY_ON
    and change it to:
    #define _ALPHAPREMULTIPLY_ON 1

    and you may have to apply the fix for _CameraDepthTexture_TexelSize.zw too
    simply replace it with _ScaledScreenParams.xy
     
    Last edited: Jul 30, 2022
    dFlynnSo and AGregori like this.
  40. al3xj3ns3n

    al3xj3ns3n

    Joined:
    Sep 10, 2018
    Posts:
    21
    I've been encountering an issue with a modified version of the Lux decal scripts projecting onto multiple game objects at the same time, was hoping someone might be able to help identify what's going on. Capture.PNG
    We're using the decal as a way to highlight areas on this globe asset. I've gone in and physically separated the four quarters of the globe asset to show that they're 4 different individual meshes, but I imagine we'd see similar issues with any number of meshes as long as there are multiple. These strange tears in the decal start flickering constantly, the screenshot shows one over Democratic, near Nambibia, and Madagascar. Capture.PNG
    When I enter the inspector and disable all but one of the quarters, that quarter does not have any of the flickering effect and renders as it is supposed to render, meaning the issue is being caused by the decal projecting onto multiple meshes at once. I'm not really sure what I should do to try and fix it though. Any thoughts?
     
  41. Slashbot64

    Slashbot64

    Joined:
    Jun 15, 2020
    Posts:
    335
    yeah but that is not something that works with a shader made in shader editor (unity's or amplify) is it... like the opacity option on the material being at 50%/grey would allow light through a cast a dithered shadow like it did in BIRP..

    honestly I don't get why URP is this backwards.. now it seemsyou've got to dig into the internals of unity's unfinished URP mess to make dithered shadows work.. its just weird and off putting.
     
  42. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    look into the draw order using the frame debugger.
     
  43. al3xj3ns3n

    al3xj3ns3n

    Joined:
    Sep 10, 2018
    Posts:
    21
    Not sure what I'd be looking for, here's the debugger output.

    upload_2022-8-26_10-38-28.png

    The four draw mesh tile visual calls are the four quadrants of the globe, and the three draw mesh untitled polygons are the draw calls that generate the pink decal.
     
  44. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    these draws are in the opaque queue -> you do not have a valid camera depth texture here as it is from the last frame. try to set the decal shader to transparent.
     
  45. al3xj3ns3n

    al3xj3ns3n

    Joined:
    Sep 10, 2018
    Posts:
    21
    upload_2022-8-26_15-21-52.png
    Like this?
     
  46. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    yes, does it help?
     
  47. al3xj3ns3n

    al3xj3ns3n

    Joined:
    Sep 10, 2018
    Posts:
    21
    Unfortunately not, that was already how it was set up, I didn't change anything.
     
  48. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    did not see it before but you are using some "stencil do something shaders" there. not sure what these are good for.
     
  49. al3xj3ns3n

    al3xj3ns3n

    Joined:
    Sep 10, 2018
    Posts:
    21
    They're a modified version of the Lux URP Lit Decal shader. I inherited this code from someone who doesn't work here anymore so my understanding of it isn't completely 100%

    Here's the three shaders we're using rn


    Code (CSharp):
    1. // Modified version of 'Assets\External\Lux\Lux URP Essentials\Shaders\Decals\Lux URP Lit Decal.shader'
    2. Shader "Lux URP/Projection/Decal Lit/Stencil Volume Incrementer"
    3. {
    4.     Properties
    5.     {
    6.      
    7.         [Header(Stencil)]
    8.         [IntRange] _StencilRef                          ("Stencil Reference", Range (0, 255)) = 0
    9.     }
    10.  
    11.     SubShader
    12.     {
    13.         Tags
    14.         {
    15.             "RenderPipeline" = "UniversalPipeline"
    16.             "RenderType" = "Transparent"
    17.             "Queue" = "Transparent"
    18.         }
    19.  
    20.         Pass
    21.         {
    22.             Name "StandardUnlit"
    23.             Tags{"LightMode" = "UniversalForward"}
    24.  
    25.             Stencil {
    26.                 Ref [_StencilRef]
    27.                 CompBack Gequal
    28.                 CompFront Gequal
    29.                 PassFront IncrWrap
    30.                 PassBack DecrWrap
    31.             }
    32.  
    33.             Blend SrcAlpha OneMinusSrcAlpha
    34.            
    35.             Cull Off
    36.             ZTest Gequal
    37.             ZWrite Off
    38.             ZClip Off
    39.  
    40.             HLSLPROGRAM
    41.            
    42.             #pragma vertex vert
    43.             #pragma fragment frag
    44.  
    45.             #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
    46.            
    47.             struct Attributes
    48.             {
    49.                 float4 positionOS   : POSITION;                
    50.             };
    51.  
    52.             struct Varyings
    53.             {
    54.                 float4 positionHCS  : SV_POSITION;
    55.             };          
    56.  
    57.            
    58.             Varyings vert(Attributes IN)
    59.             {
    60.                 Varyings OUT;
    61.                 OUT.positionHCS = TransformObjectToHClip(IN.positionOS.xyz);
    62.                 return OUT;
    63.             }
    64.      
    65.             half4 frag() : SV_Target
    66.             {
    67.                 return half4(0, 0.5, 0, 0);
    68.             }
    69.            
    70.             ENDHLSL
    71.         }
    72.     }
    73.     FallBack "Hidden/InternalErrorShader"
    74. }
    Code (CSharp):
    1. // Modified version of 'Assets\External\Lux\Lux URP Essentials\Shaders\Decals\Lux URP Lit Decal.shader'
    2. Shader "Lux URP/Projection/Decal Lit/Stencil Volume Render"
    3. {
    4.     Properties
    5.     {
    6.         [Header(Stencil)]
    7.         [IntRange] _StencilRef                          ("Stencil Reference", Range (0, 255)) = 0
    8.        
    9.         _Color("Base Color", Color) = (0, 0, 0.5, 0.5)
    10.        
    11.         _ObjectId ("ObjectId", Vector) = (0, 0, 0, 0)
    12.     }
    13.  
    14.     SubShader
    15.     {
    16.         Tags
    17.         {
    18.             "RenderPipeline" = "UniversalPipeline"
    19.             "RenderType" = "Transparent"
    20.             "Queue" = "Transparent"
    21.         }
    22.  
    23.         Pass
    24.         {
    25.             Name "StandardUnlit"
    26.             Tags{"LightMode" = "UniversalForward"}
    27.  
    28.             Stencil {
    29.                 Ref [_StencilRef]
    30.                 ReadMask 255
    31.                 WriteMask 255
    32.                 Pass IncrWrap
    33.                 Comp Equal
    34.             }
    35.  
    36.             Blend SrcAlpha OneMinusSrcAlpha
    37.            
    38.             Cull Off  
    39.             ZTest Off
    40.             ZWrite Off
    41.             ZClip Off
    42.  
    43.             HLSLPROGRAM
    44.            
    45.             #pragma vertex vert
    46.             #pragma fragment frag
    47.  
    48.             #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
    49.  
    50.  
    51.            
    52.             float4 _ObjectId;
    53.  
    54.             uniform float _PixelRaycastWrite;
    55.            
    56.             struct Attributes
    57.             {
    58.                 float4 positionOS   : POSITION;                
    59.             };
    60.  
    61.             struct Varyings
    62.             {
    63.                 float4 positionHCS  : SV_POSITION;
    64.             };
    65.            
    66.             CBUFFER_START(UnityPerMaterial)
    67.                 half4 _Color;          
    68.             CBUFFER_END
    69.            
    70.             Varyings vert(Attributes IN)
    71.             {
    72.                 Varyings OUT;
    73.                 OUT.positionHCS = TransformObjectToHClip(IN.positionOS.xyz);
    74.                 return OUT;
    75.             }
    76.        
    77.             float4 frag() : SV_Target
    78.             {
    79.                 if(_PixelRaycastWrite > 0.5f)
    80.                 {
    81.                     float4 result = _ObjectId;
    82.                     if(_Color.a == 0.0f)
    83.                     {
    84.                         result.a = 0.0f;
    85.                     }
    86.                    
    87.                     return result;
    88.                 }
    89.  
    90.                 return _Color;
    91.             }
    92.            
    93.             ENDHLSL
    94.         }
    95.     }
    96.     FallBack "Hidden/InternalErrorShader"
    97. }
    Code (CSharp):
    1. // Modified version of 'Assets\External\Lux\Lux URP Essentials\Shaders\Decals\Lux URP Lit Decal.shader'
    2. Shader "Lux URP/Projection/Decal Lit/Stencil Volume Reset"
    3. {
    4.     Properties
    5.     {
    6.         [Header(Stencil)]
    7.         [IntRange] _StencilRef ("Stencil Reference", Range (0, 255)) = 0
    8.     }
    9.  
    10.     SubShader
    11.     {
    12.         Tags
    13.         {
    14.             "RenderPipeline" = "UniversalPipeline"
    15.             "RenderType" = "Transparent"
    16.             "Queue" = "Transparent"
    17.         }
    18.  
    19.         Pass
    20.         {
    21.             Name "StandardUnlit"
    22.             Tags
    23.             {
    24.                 "LightMode" = "UniversalForward"
    25.             }
    26.  
    27.             Stencil
    28.             {
    29.                 Ref [_StencilRef]
    30.                 ReadMask 255
    31.                 WriteMask 255
    32.                 Pass DecrWrap
    33.                 Comp Equal
    34.             }
    35.  
    36.             Blend SrcAlpha OneMinusSrcAlpha
    37.  
    38.             Cull Off
    39.             ZTest GEqual
    40.             ZWrite Off
    41.             ZClip Off
    42.  
    43.             HLSLPROGRAM
    44.            
    45.             #pragma vertex vert
    46.             #pragma fragment frag
    47.  
    48.             #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
    49.            
    50.             struct Attributes
    51.             {
    52.                 float4 positionOS   : POSITION;
    53.             };
    54.  
    55.             struct Varyings
    56.             {
    57.                 float4 positionHCS  : SV_POSITION;
    58.             };
    59.  
    60.            
    61.             Varyings vert(Attributes IN)
    62.             {
    63.                 Varyings OUT;
    64.                 OUT.positionHCS = TransformObjectToHClip(IN.positionOS.xyz);
    65.                 return OUT;
    66.             }
    67.        
    68.             half4 frag() : SV_Target
    69.             {
    70.                 return half4(0, 0, 0, 0);
    71.             }
    72.            
    73.             ENDHLSL
    74.         }
    75.     }
    76.     FallBack "Hidden/InternalErrorShader"
    77. }
     
  50. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,907
    hmm, looks too complicated to me. if you have 4 decals each covering 1/4th of the globe you should get away without using any stencils here.