Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[Released] Lux LWRP Essentials

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

  1. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    oh, your suggestion would need one material per team - but only one albedo texture.
    picking up colors and replacing them based on a reference values sounds quite complicated.
    furthermore: how would this play with mip maps? not at all...

    team color solutions i know are based on mask maps. and if your material is opaque you should be able to use the albedo's alpha channel to store this map.
    from there it is just a few steps to get it up and running.
     
  2. Interjection

    Interjection

    Joined:
    Jun 18, 2020
    Posts:
    54
    Yes, one material per team. Colors would only be replaced visually (what you see on screen) the albedo itself and all mip maps are unchanged. Since height maps and normals change the appearance of a pixel I thought it would be easy to check if a pixel is a certain color and change the appearance to another color if that is the case.

    What about the simpler Alpha Replace idea?

    For example if Alpha Replace is red and the pixel is fully transparent the pixel would show up as red with no alpha. If it has 50% alpha it would have 50% red added to whatever color was there before, and show up as semi-red with no alpha on that pixel.
     
    Last edited: Jun 18, 2020
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    mip maps are a huge problem: so if a pixel is red in mip 0 it might be pink in mip 2. but you will still want to colorize it - a bit at least.
    to be honest: i did not read into it.
    if you need team colors, use a mask map. you may store it in the alpha channel of the albedo e.g.
    then do proper premultiplied blending.
    it works perfectly with mip mapping.
     
  4. Interjection

    Interjection

    Joined:
    Jun 18, 2020
    Posts:
    54
    Is that possible with your über shader right now or do I need to edit the shader code? I bought the asset to specifically not need to learn how to code shaders or use shader graph so I can focus on making a game instead, which is why I'm making the request. (Sorry, I don't understand what you mean with use a mask map and do proper premultiplied blending.) If you don't think it's worth your time to add the alpha replace feature I understand, but I think it would be useful to many people and add even more value to your bundle.

    Btw I've noticed that Unity's Lit shader supports alpha cutoff with Transparent surface type while your über shader does not, is that a bug or a limitation with your shader?
     
  5. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    you will have to edit the shader code.
    i simply do not want to bloat the shader. so it centered around advanced lighting features and some additional rendering features such as parallax or camera fading i personally find important.
    it is really hard to imagine any use case for uber + transparent + cut out. if you look into the features uber offers there is hardly anything a transparent shader would really benefit from.
    but the shader supports it. it is just not exposed by the inspector.
     
  6. Interjection

    Interjection

    Joined:
    Jun 18, 2020
    Posts:
    54
    I thought bloating was kinda implied by the name "Lit Extended Über"; to make it as über as possible. =P If you ever make a "Lit Extended Über Bloated" shader I'd use it!

    If it's supported but intentionally hidden you ought to change that because a potential buyer might notice it and figure that if the über shader takes a step backwards there (compared to Unity's Lit) then what else could be wrong.

    As for a use case, alpha cutoff on transparent could be used for a cheap death animation. The camera fade would also be nice to have even on transparent materials, if that's possible.
     
  7. Interjection

    Interjection

    Joined:
    Jun 18, 2020
    Posts:
    54
    Another thing I'd like to see when using the Transparent surface type is a "Fade override" checkbox, with a 0-1 slider. What this would do is make the über shader (bloated edition) pretend all pixels in the albedo has 0-1 alpha value.

    Checking "Fade override" would fully re-enable "Alpha Clipping" since the albedo alpha values are not used to get the transparency anymore, the slider is used for that. It also fully re-enables "Alpha Replace" in my dream.

    The "Fade override" checkbox would be useful to allow people to have transparent textures without modifying the images. It would also allow you to easily fade out textures using C#.
     
  8. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    in case i do not miss anything this slider is already in: it is the alpha value of the base color (next to the base texture).which of course can be changed using c#.
     
  9. Interjection

    Interjection

    Joined:
    Jun 18, 2020
    Posts:
    54
    You're right about that, however it's not the same. It would still be useful to have the separate "Fade override" since you can then use the alpha stored in the albedo only for "Alpha Clipping" or "Alpha Replace", not for transparency.

    - Currently the albedo color alpha multiplies the alpha values in the albedo map, so if you have 50% alpha in the base map white color it would create 25% alpha pixels from 50% alpha pixels in the albedo map.
    - But with "Fade override" set to 50% the 50% alpha pixels in the albedo map would have exactly 50% alpha. 1% alpha pixels in the albedo would also have exactly 50% alpha.

    If "Fade override" is set at 100% there would be no transparency in any albedo map pixels, even if they have alpha stored. The point is that they can then be used for "Alpha Cutoff" (or "Alpha Replace", which is my previous request that uses the albedo alpha to mix in a color).

    "Fade override" together with "Alpha Replace" would make it possible to have fading textures where alpha values in the albedo gets swapped out with a team color.
     
  10. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    356
    Hey, in the skin shader, is there supposed to be a way to tint the albedo?
    I see the BaseColor property is hidden and not used. I added it in "InitializeSkinLitSurfaceData"

    outSurfaceData.albedo = albedoAlpha.rgb *_BaseColor;

    I'm just wondering if that'll cause other issues or is missing from other areas?
     
  11. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    you should be fine doing so.
     
    kenamis likes this.
  12. Interjection

    Interjection

    Joined:
    Jun 18, 2020
    Posts:
    54
    Would it be possible to change Rim Lighting to Rim Color and have a checkbox to make it emissive? That way we could use non-emissive black to add some extra fake shades to objects and make it stick out more from the background.

    It would also allow the rim to be affected by other shadows (currently having blue Rim Lighting in a pitch dark shadow is still visible, a blue Rim Color with unchecked "emissive" would not be).
     
  13. Interjection

    Interjection

    Joined:
    Jun 18, 2020
    Posts:
    54
    It's apparent that you prefer not changing the über shader further but before I leave I'll write my three final suggestions:

    1. A checkbox for displaying the render queue in the Inspector, or if unchecked display the newer "Priority" system in Unity. I'm not a fan of the "Priority" system but as time goes by people will only get more and more used to being able to set the "Priority" instead of modifying the Render Queue directly so it would improve the useability of your shader if you added this checkbox.

    2. All settings should have tooltip descriptions when you hover over them in the Inspector. That way if someone forgets what "Horizon Occlusion" does (for example) all he needs to do is hover the text for a reminder instead of looking it up in the manual, which takes more time to do.

    3. When you make a Material using the über shader from code the default albedo color is {128,128,128,255}. I suggest changing it to the same as Unity's Lit shader: {255,255,255,255} It seems like you have _Color as white in the shader but you also need to set _BaseColor to white.
     
  14. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    oh, how do you know? because there is no update yet?
    things take time and these days. they take 3 times the time...

    but you are right to a certain point: it will keep the uber shader more or less untouched. instead i will add some more nodes for shader graph and add some example shaders. maybe even a parallax, near fade, team color shader.

    1. i will not break unity's setup.
    2. shaders have a help button at the top of the inspector where you get way more and better formatted/readable info than a tooltip can provide.
    3. np
     
  15. Interjection

    Interjection

    Joined:
    Jun 18, 2020
    Posts:
    54
    >oh, how do you know
    It was just an assumption since you said you didn't want to bloat the über shader and then you didn't respond to the post where I asked if it was possible to replace "Rim Lighting" with "Rim Color with an emission checkbox". Regardless, looking forward to see what more you make. Maybe I'll take a look at shader graph eventually.
     
  16. Tesrym

    Tesrym

    Joined:
    Dec 2, 2012
    Posts:
    59
    I have black grass in the shadow cascade blends.
    (Cascades pulled close to camera for this post screenshot)
    Using Unity 2019.4.1f1, URP 7.3.1, Lux URP Essentials 1.44
     

    Attached Files:

  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    hmm,it all looks a bit off.
    but i have not tried 2019.4. so far i have to admit. any chance you test it in 2019.3?
     
  18. Tesrym

    Tesrym

    Joined:
    Dec 2, 2012
    Posts:
    59
    Tried 2019.3.15f1. No change.

    Edit: revisited project now and this problem that has been with me for many days is now gone and I am not able to reproduce it.
     
    Last edited: Jul 5, 2020
  19. Holoboost

    Holoboost

    Joined:
    Jul 6, 2020
    Posts:
    4
    Hi larsbertram1,

    is there any chance u can fix the human skin shader on URP 7.4 and unity 2019.4.1f1 LTS? It doesn’t work on oculus Quest. Character turns into a weird bluish tint. It works if I apply your fix on line 290, but only if it’s not using SRP. However, we need it to work in SRP.
     
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    it should be fine in general.
    what is that fix in line 290? sorry if i just forgot about it: too much going on on here...
    if it does not work with the srp batcher it is a bit more expensive but should just be fine.
     
  21. freso

    freso

    Joined:
    Mar 19, 2013
    Posts:
    25
    Hi, nice shaders. I like how you can set your own stencil values and read/write mask. Very handy for the outline shader.

    I'm now playing around with LOD Groups, and was wondering if it would be possible for you to add LOD cross-fade dithering support? If I understand things correctly, Unity has the dithering function ready but just not activated. I tried seeing if I could do it myself following this guide at the bottom, but I'm too stupid. https://catlikecoding.com/unity/tutorials/rendering/part-18/
     
  22. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    i will look into this.
     
    freso likes this.
  23. freso

    freso

    Joined:
    Mar 19, 2013
    Posts:
    25
    Thanks, that would be awesome. Popping objects can be an eye-sore.

    I have another question/request. :)
    I'm working on a VR game and stuff without AA really stands out. I noticed the billboard shader has Surface options -> Alpha -> Blended/Tested, where blended mode made MSAA work. However, I don't see such an option in the Vegetation and Nature shaders. Is it possible to add this 'blended' option to these shaders? Or is there a better solution to make MSAA work? (I'm guessing this problem exists for all cut-out textures)
     
  24. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    blnding does not "enable MSAA": it just blends according to the alpha value and makes your material being handled as transparent.
    you do not want to blend vegetation as you would get sorting issues etc: all stuff related to transparents.
    the solution would be using alpha to coverage – like the hair shader offers.
    so all you have to to is to add:
    "AlphaToMask ON"
    right after "Cull [_Cull]" in the "ForwardLit" pass of the shader you want this feature.
     
  25. Jess_AA

    Jess_AA

    Joined:
    May 8, 2019
    Posts:
    18
    I'm using a glass setup for refraction similar to yours with two materials, one for the inner faces and one for the outer. I'm adding a depth only shader to allow it to work with DOF but it's then only rendering the outer faces, which is then drawing over the inner faces (I think I'm understanding/explaining that correctly!). What I wanted to know is if there is in fact a way to have that setup, with two materials for the inner and outer faces, but also with a depth only shader which renders both and allows it to be used with DOF.

    As always, loving the shaders! An indespensible part of our workflow.
     
  26. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    tricky one... and if have no answer yet.
    adding the depth only shader will write depth like used by the outer faces. so when it comes to rendering the inner ones the depth test will fail and all pixels belonging to the inner faces will be rejected :(
    i am not sure if we can manually render into the cameradepthtexture at a later point (probably not). so another possibility might be to write your own dof shader reading from 2 different depth buffers... but who shall write this?
     
  27. Abended

    Abended

    Joined:
    Oct 9, 2018
    Posts:
    75
    Hi there! Really enjoying the functionality. Hoping you can guide me a bit on this one.
    I am trying to use the fast outline shader but just show hidden surfaces, no outlines. I have a target, which when not visible, I would like to show as greyscale. Each slice of the target is a separate object. White, Black, Blue, Red, and Yellow. they all pancake on each other. I believe the example in the guide, although right after the Hidden Surfaces section, isn't specific to that feature. I have one material on each object that is the standard lit material. I have a secondary material using the Lit Extended material. Lit extended options are greater and 0 for the stencil. I am only seeing the backmost object, which I sort of get because I am setting them all to greater. but I don't see the regular material when the target is not blocked by other objects. Any ideas?
     
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    sorry, but i can hardly follow your description...
    when it comes to stencil buffers things get really complicated quite fast. so i have not checked anything but using one single material per object always.
    regarding the regular material (using standard lit): it should neot be effected by the stencil buffer at all (unless unity has changed anything with latest urp updates). so there is no reason i can think of it does not render.
     
  29. freso

    freso

    Joined:
    Mar 19, 2013
    Posts:
    25
    Wow, that was easy. Thank you very much for the solution. It worked perfectly!
     
  30. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    i am glad you managed to add it!
     
  31. Jess_AA

    Jess_AA

    Joined:
    May 8, 2019
    Posts:
    18
    Thanks Lars, that's what I suspected but just wanted to hear it from the man himself :)
     
  32. Abended

    Abended

    Joined:
    Oct 9, 2018
    Posts:
    75
    LUX dude!

    I have managed to create my own procedural shader. My intent was to use it as a decal and control how it looks. Would there be any way for me to make the output of my shader the input texture for the lit decal? Or possibly marry them both? I was hoping decal was a subgraph or a node, but it was not.
     
    Last edited: Jul 11, 2020
  33. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    the decal shader uses functions not supported by shader graph.
    in order to make the decal shader use your procedural texture you have to render it upfront to a render texture target then feed this into the decal shader (or set it as global texture and make the decal shader read the global texture).
     
  34. projectorgames_unity

    projectorgames_unity

    Joined:
    Oct 15, 2018
    Posts:
    29
    Just bought and imported this and am getting 13 errors in my project:

    Assets\Asset Packs\Lux URP Essentials\Lux URP Essentials\Scripts\Procedural Texturing\Editor\ProceduralTexture2DEditor.cs(122,45): error CS0246: The type or namespace name 'ProceduralTexture2D' could not be found (are you missing a using directive or an assembly reference?)

    Assets\Asset Packs\Lux URP Essentials\Lux URP Essentials\Scripts\Terrain Blend\GetTerrainHeightNormalMap.cs(16,24): error CS0029: Cannot implicitly convert type 'UnityEngine.TerrainData' to 'TerrainData'

    Assets\Asset Packs\Lux URP Essentials\Lux URP Essentials\Scripts\Decals\Editor\DecalEditor.cs(6,23): error CS0246: The type or namespace name 'Decal' could not be found (are you missing a using directive or an assembly reference?)

    Assets\Asset Packs\Lux URP Essentials\Lux URP Essentials\Lux SRP Grass Displacement\Scripts\Editor\LayerAttributeDrawer.cs(12,32): error CS0246: The type or namespace name 'LayerAttribute' could not be found (are you missing a using directive or an assembly reference?)

    Assets\Asset Packs\Lux URP Essentials\Lux URP Essentials\Scripts\Terrain Blend\Editor\GetHeightNormalMapEditor.cs(11,24): error CS0246: The type or namespace name 'GetTerrainHeightNormalMap' could not be found (are you missing a using directive or an assembly reference?)
     
  35. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    hmm, this has not been reported by anybody else so far.
    first test: just reimport the package.
     
  36. kry8ter

    kry8ter

    Joined:
    Jun 24, 2020
    Posts:
    3
    Few months ago, I make some custom textures and fire up Unity for the first time. Make some trees via the Creator, and some grass, and a large landscape. Did some vids on youtube, marched forward, things were looking great, people were starting to invest in my energy, then I upgraded to URP...

    As a texture artist I wanted access to Shader Graph, but I had no idea [URP] was going to muck up everything Terrain related, especially trees and grass.

    My team got LuX Essentials today.
    ----------------------
    ON FOLIAGE

    The documentation is pretty clear on a lot of things, but I'm having rotten luck with getting my Foliage to render well.

    Even Unlit, the Transmission looks great. I love flying behind my stuff and seeing the light come through just right.

    It's also nice to see my stuff moving again. That one, little effect, sells the magic to my audience (most of whom don't PLAY games).

    It's when it comes down to dropping in the normal that things get bad. Having a "Normal Strength" slider seems standard and like a missing feature.

    I AM using a Spectacular workflow and maybe need to understand how to use Smoothness better (is it just inverse Spec?) on a shader with no Spec slot.

    Knowing Photoshop well, I DID shuffle my channels around, but man what an unconventional pain. It would be nice to have Normal and Transmission separate so we can futz with the values and iterate quicker. Even if it's just a fork of the current shader.

    Do you have ideas as to why, on Lighting, my meshes become black? I am using 2 sided.
    Despite HAVING normals, I read somewhere that we should bake normals OUT of crazyBump twice as strong?
    They seem to have little-to-no effect here.


    Lit



    Unlit


    Enable Transmission [Unchecked Now]


    Do the Channel Shuffle!


    I'd like to understand what I'm doing wrong as once these lil bugs are out of the way I hope to sprint to make TONS of plants!

    ------------------------------------
    TREES!

    For the "demo" I did a few months back I created 2 trees via the Tree Creator.
    It would be nice if we could get a step by step guide on how to make things GO.
    I went back and added the right shaders to my old trees with limited effect.
    Do things go better if you make NEW trees?
    Seems inconsistent on when things'll will look good using the Optimized shader or not.

    Additionally switching between nodes in the Tree Creator can make it crap out and switch textures unexpectedly. I don't understand how/when it does this as to avoid it, or lean into it when I want. It frustrates progress.

    So the first issue is how to actually apply the shaders, well; and have them stick.

    The second issue you can see pictured, and is beyond me (I've poked at this for too long). While I'm happy to see your terrain shader RECEIVES shadows well. I can't get the "leaves" to show dynamic shadows. Since I made my trees static, on accident, there ARE shadows in the "bake".



    Any hints/tips/tricks you can share would be great.
    -----------------------------------------------
    Lastly,

    I'm not sure what's best practices now.
    I have only just, today, installed Polybrush
    I see Trees only "bend" in the wind if they placed, the old way, on a Terrain.

    Should we bother putting oldGrass on Terrains?
    I want to target lower end machines maybe even iPads.
    Is your grassPrefab more "performant" than terrain Grass?

    Do folks not use Terrains, and just sculpt large meshes they then paint them via Polybrush?
     
  37. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    thanks for your post!

    i am a bit picky about this... usually when it comes to features tweaking values in the shader you can tweak using photoshop i leave them out due to performance.
    but as it use ag packing which is difficult to tweak i will add this in the next update. performance impact should be ok.

    packing textures together is a quite common way to improve performance. just use adjustment layers in photoshop and limit them to e.g. the red color channel in case you want to tweak translucency.

    your texture channel packing looks ok. so maybe you do not have "sRGB (Color Texture)" unchecked in the import settings of the combined texture? simply uncheck "Enable Normal Smoothness Trans Map" in the shader to see how it looks without the map being applied.
    sometimes unity does not import the proper photoshop alpha channel. so have a look if your imported texture is rgba and go through the channels.

    In the "Vegetation Demo" you will find a manually placed tree bending in the wind.

    Please have a look at the provided tree example and the docs: you do not assign the optimized shaders to your materials like the bark material assigned in the geometry section of the tree creator but the regular ones.
    from the docs:

    Usage

    In order to make your trees use the Lux LWRP tree creator shaders you have to assign the Lux LWRP Tree Creator Bark and the Lux LWRP Tree Creator Leaves shader to the base materials you use to create the tree (the materials which are assigned e.g. in the Branch Material or Break Material slot of the tree creator). Then refresh the tree.

    The final tree will be rendered using the LWRP Tree Creator Bark Optimized and the Lux LWRP Tree Creator Leaves Optimized shaders. These need the related “Rendertex” shaders which will be used to render the billboard textures.

    using the terrain engine unity will generate huge grass patches when they come into sight. performance of this has been greatly improved during the last months but creating these meshes still spike on the cpu.
    depending on your grass density srp batcher can do quite a good job. so when combined with layer based culling even adding several thousand instances of a grass prefab may run pretty fast.

    depends. built in terrains give you automatic LODs and fast physics. however in order to sculpt details into a unity terrain you have to have a rather high hight map resolution which in most cases is just wasted and only needed at some very special locations.
    try to recreate the provided mesh terrains using a built in one and you will see :)
    on the other hand unity terrains offer a lot of tools and can be created and tweaked fully in the editor.
     
  38. kry8ter

    kry8ter

    Joined:
    Jun 24, 2020
    Posts:
    3
    In my project most my Textures are PNG. For these LuXNrm textures I've been using TIF since it should preserve the Alpha. I am not using PSDs, should I be?

    --------------------------

    So I did some experiements. Same as the pics I included before.

    Baked Lighting with the [Enable Normal Smoothness Trans Map] unchecked.


    Checking it right after the bake. Things turn black.


    Here I've kept it checked and cleared the bake. Things look odd from a spec and normal standpoint much darker on the leaves on the left.


    Having an idea that MAYBE this was a fault in my mesh imports or somesuch ignorance, I applied this to a sphere as well.


    Despite my tests, thing still render black. Going to look into the test scenes now.


    So I went into the Demos (which are super cool by the way, that blending in the Terrain on is sick!). I set the foliage in this row to take shadows and rendered... looks pretty good.


    I just must be doing something wrong with that Trans map. Does it HAVE to be a PSD? :/
     
  39. Abended

    Abended

    Joined:
    Oct 9, 2018
    Posts:
    75
    LARS MAN!

    I have got a render texture working for the decal. I am using a script to blit the shader's material and the render texture together. I would like to use a material property block to control my procedural shader, but since that goes through the renderer of the decal, I don't know if I can control it since it's material is related to the texture of the decal.

    I feel like everytime I explain something to you it runs through a maze of connectivity. If I hook up a MBR to your decal's
    renderer, I don't think I can control my shader's properies. Is there a way or is this not possible?
     
  40. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    i find .png a bit tricky as especially photoshop does not handle the alpha properly.
    .tga should be rock solid.
    and .tif is nice as it allows you to a) keep photoshop adjustment layers and b) supports compression (lossless).
     
  41. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    hmm, i am not sure if i get you.
    i do not understand why you blit render texture and material together upfront - and not simply send the rt to the decal and combine it there?!

    what is a MBR? or did you mean MPB = material property block?
    you can use a mpb on the decal shader but loose srp batcher compatibility which may or may not be any issue depending ob the amount of decals you draw.
     
  42. Abended

    Abended

    Joined:
    Oct 9, 2018
    Posts:
    75
    Do I add my material to the decal as a second material? Maybe that is the step I'm missing? I jumped through a lot of hoops to get the RT to work correctly. I tried a custom render texture at first, but could not get that to work.
     
  43. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    oh, i might have misunderstood you then. i thought you jst combined the render texture with the decal.
    not the rendertexture with something else and then with whatever is on the decal...
     
  44. Abended

    Abended

    Joined:
    Oct 9, 2018
    Posts:
    75
    The rendertexture is a procedural shader. I would like to get a MPB on that. But it seems to be connected to the decal in a way that I can't use an MPB on it. Do you have a suggestion there?
     
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    may be misunderstanding you again. but if you create a render texture in the project tab you can simply assign it to the decal material (drag and drop).
    if you create the rt from script you can assign it globally using Shader.SetGlobalTexture("_ProceduralTex", ... this would need you to edit the decal shader and rename its texture property to "_ProceduralTex" as well.
     
  46. Abended

    Abended

    Joined:
    Oct 9, 2018
    Posts:
    75
    Ah, I can now use the render texture to create pngs on the fly, so I can use the procedural shader to do the "animation" and when that's done I can just create the static PNG and swap it for the decal texture. I think that will do the trick. Thanks for the pointers!
     
  47. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    that sounds quite expensive memory wise... why not feeding the rt into the decal shader?is the procedural shader such expensive? or do you just have 5 frames?
    nice thing about procedural: you can have endless variations. for a fixed price memory and gpu time wise.
    maybe you can post an image of what you are going to achieve?
     
  48. fjhamming_CleVR

    fjhamming_CleVR

    Joined:
    Feb 6, 2014
    Posts:
    10
    When building for the first time from a command line in 2019.4.3 LTS with URP 7.3.1 I get the following error:
    Code (CSharp):
    1. Shader error in 'Lux URP/Vegetation/Foliage': Output variable ShadowPassVertex contains a system-interpreted value (SV_RenderTargetArrayIndex) which must be written in every execution path of the shader.  Unconditional initialization may help. at line 359 (on d3d11)
    2.  
    3. Compiling Vertex program with UNITY_PASS_SHADOWCASTER STEREO_INSTANCING_ON
    4. Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR
    5.    
    6. [EDITOR] Shader error in 'Lux URP/Vegetation/Foliage': Output variable ShadowPassVertex contains a system-interpreted value (SV_RenderTargetArrayIndex) which must be written in every execution path of the shader.  Unconditional initialization may help. at line 359 (on d3d11)
    7.  
    8. Compiling Vertex program with UNITY_PASS_SHADOWCASTER STEREO_INSTANCING_ON
    9. Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR
    10.  
    I tried initializing the output I found somewhere on the web, but couldnt fix it so quickly. Building manually once seems to be a workaround. Any ideas?
     
  49. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,869
    not really (error looks quite strange especially if you look into the keywords which are from the built in render pipeline). kicking off a built sometimes creates errors. a 2nd run usually fixes all errors.
     
  50. Abended

    Abended

    Joined:
    Oct 9, 2018
    Posts:
    75
    Lars,
    I have some striped circles in a 3x3 grid that I can turn on or off with varying sizes using the procedural shader. I am creating procedural fairways with mowed grass. I only need 5 or so decals per scene with the RT. Once the creation animation is complete, I can create the texture in memory and swap it for the RT in the decal for the remainder of the hole. I am working on trying to reduce the resolution of the texture once I get it in memory. Currently, the texture is 1024x1024, but I think it may look ok @ 512 or maybe 256, not sure.
    upload_2020-7-17_10-23-21.png
     

    Attached Files:

    • QUAD.png
      QUAD.png
      File size:
      236.9 KB
      Views:
      17
unityunity