Search Unity

Shader Forge - A visual, node-based shader editor

Discussion in 'Assets and Asset Store' started by Acegikmo, Jan 11, 2014.

  1. MrStroganoff

    MrStroganoff

    Joined:
    Feb 2, 2016
    Posts:
    1
    Would you be cool with showing the node tree for this? I have tryed to make a skin shader so manny times but I cant quite understand how to make the specularity and SSS look good. Your stuff looks awesome though!
     
  2. MarcusValerius

    MarcusValerius

    Joined:
    Aug 1, 2016
    Posts:
    12
    Hi, everyone.
    I was wondering if it's possible to build a normal mapped particle shader in Shader Forge.
    One that lights each billboard particle from above like it's illuminated by the sky, regardless of the individual particle's rotation.
    Ideally with a slight tilt towards the camera as in the newer Super Mario games:


    I wasn't able to find any information on this topic anywhere, even though you see normal mapped smoke, blood etc. in practically every game.
    Maybe plugging the normal direction, a vector3 and... some other stuff into the Custom Lighting input will do the trick? Some help from the experts would be much appreciated, this turned out to be a lot more of a challenge than I had hoped.
     
    Last edited: Oct 20, 2016
  3. ATLAS-INTERACTIVE

    ATLAS-INTERACTIVE

    Joined:
    Mar 3, 2014
    Posts:
    1,295
    Hey Guys,

    I have a shader which I am trying to use on a UI Canvas but it isn't rendering, clicking the Pixel Snap value in the inspector makes just the edges visible but it is still not usable.

    On Play I get this error:
    Material doesn't have a texture property '_MainTex'
    UnityEngine.Canvas:SendWillRenderCanvases()

    But many UI shaders such as the Color one don't have texture properties and work just fine, is there an option I need to check in SF to make it work with the UI or something?
     

    Attached Files:

  4. retmia

    retmia

    Joined:
    May 31, 2013
    Posts:
    25
    Hello Shader Forgers,

    I'm trying to make a normal map dimmer, I though of making something simple like that, but it doesn't react as expected in engine. Shading lighter or darker the faces of the mesh (It also needs to be compatible with mirrored Uvs)
    Do you know how to achieve it correctly ?

    Thanks !

    normal_dimming.png
     
  5. Michiel-Frankfort

    Michiel-Frankfort

    Joined:
    Sep 7, 2014
    Posts:
    39
    Hi all, I'm not sure if this is the right place to share this, but I wanted to share an image that explains how to correctly create an UI-shader that works with Unity's UI-Mask component. I have been struggeling with this a bit and answers / examples online didn't work for me correctly. This does, so here you go...

     

    Attached Files:

    Last edited: Oct 28, 2016
    MS80, q7204k, hopeful and 1 other person like this.
  6. kevincfy

    kevincfy

    Joined:
    Oct 12, 2012
    Posts:
    16
    Been having an issue with a mobile VR app using Google's VR SDK. The app runs fine using the standard shader, but I've a custom shader forge shader better suited to my needs which works well in the main but has horrid dancing white pixels on device.

    Anything I might be missing in regards to using SF on mobile? I think it might be related to normals and specular and I've tried switching from normalized normals to interpolated normals which makes no difference. I'm also have "force shader model 2.0" checked along with "OpenGL ES 3.0".

    If you look at the screengrabs you'll see the white pixels, different in each eye, and they change every frame.

    Any help would be much appreciated!

    shaderforge-pixels.PNG
    shaderforge_shader.PNG
     
  7. q7204k

    q7204k

    Joined:
    Dec 4, 2011
    Posts:
    15
    Hello everyone)
    Is there an analog of "world position offset" from UE4? Or some way to replicate it?
     
  8. MS80

    MS80

    Joined:
    Mar 7, 2014
    Posts:
    335
    Thanks @Michiel-Frankfort
    It works! What would you suggest to use this shader with not masked images, too?
     
    Last edited: Oct 30, 2016
    Michiel-Frankfort likes this.
  9. Michiel-Frankfort

    Michiel-Frankfort

    Joined:
    Sep 7, 2014
    Posts:
    39
    You are most welcome!
    About your question: it appears that the normal Unity UI shader also has simular stencils settings by default, so from a performance perspective its okay I think.

    I did however ran into a problem where sometimes the "Comp LEqual" doesnt work well and needs to be set to "Comp Less"... just so you know...
     
  10. bringclose

    bringclose

    Joined:
    Nov 20, 2014
    Posts:
    7
    Hi Everyone,

    I have a unity shader
    "Legacy Shaders/Transparent/VertexLit"
    and
    "Mobile/Unlit (Supports Lightmap)"

    Code (CSharp):
    1. Shader "Legacy Shaders/Transparent/VertexLit" {
    2. Properties {
    3.     _Color ("Main Color", Color) = (1,1,1,1)
    4.     _SpecColor ("Spec Color", Color) = (1,1,1,0)
    5.     _Emission ("Emissive Color", Color) = (0,0,0,0)
    6.     _Shininess ("Shininess", Range (0.1, 1)) = 0.7
    7.     _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
    8. }
    9.  
    10. SubShader {
    11.     Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
    12.     LOD 100
    13.  
    14.     ZWrite Off
    15.     Blend SrcAlpha OneMinusSrcAlpha
    16.     ColorMask RGB
    17.      
    18.     // Non-lightmapped
    19.     Pass {
    20.         Tags { "LightMode" = "Vertex" }
    21.         Material {
    22.             Diffuse [_Color]
    23.             Ambient [_Color]
    24.             Shininess [_Shininess]
    25.             Specular [_SpecColor]
    26.             Emission [_Emission]
    27.         }
    28.         Lighting On
    29.         SeparateSpecular On
    30.         SetTexture [_MainTex] {
    31.             Combine texture * primary DOUBLE, texture * primary
    32.         }
    33.     }
    34.  
    35.     // Lightmapped, encoded as dLDR
    36.     Pass {
    37.         Tags { "LightMode" = "VertexLM" }
    38.      
    39.         BindChannels {
    40.             Bind "Vertex", vertex
    41.             Bind "normal", normal
    42.             Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
    43.             Bind "texcoord", texcoord1 // main uses 1st uv
    44.         }
    45.         SetTexture [unity_Lightmap] {
    46.             matrix [unity_LightmapMatrix]
    47.             constantColor [_Color]
    48.             combine texture * constant
    49.         }
    50.         SetTexture [_MainTex] {
    51.             combine texture * previous DOUBLE, texture * primary
    52.         }
    53.     }
    54.  
    55.     // Lightmapped, encoded as RGBM
    56.     Pass {
    57.         Tags { "LightMode" = "VertexLMRGBM" }
    58.      
    59.         BindChannels {
    60.             Bind "Vertex", vertex
    61.             Bind "normal", normal
    62.             Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
    63.             Bind "texcoord1", texcoord1 // unused
    64.             Bind "texcoord", texcoord2 // main uses 1st uv
    65.         }
    66.      
    67.         SetTexture [unity_Lightmap] {
    68.             matrix [unity_LightmapMatrix]
    69.             combine texture * texture alpha DOUBLE
    70.         }
    71.         SetTexture [unity_Lightmap] {
    72.             constantColor [_Color]
    73.             combine previous * constant
    74.         }
    75.         SetTexture [_MainTex] {
    76.             combine texture * previous QUAD, texture * primary
    77.         }
    78.     }
    79. }
    80.  
    81. }
    Code (CSharp):
    1. // Unlit shader. Simplest possible textured shader.
    2. // - SUPPORTS lightmap
    3. // - no lighting
    4. // - no per-material color
    5.  
    6. Shader "Mobile/Unlit (Supports Lightmap)" {
    7. Properties {
    8.     _MainTex ("Base (RGB)", 2D) = "white" {}
    9. }
    10.  
    11. SubShader {
    12.     Tags { "RenderType"="Opaque" }
    13.     LOD 100
    14.  
    15.     // Non-lightmapped
    16.     Pass {
    17.         Tags { "LightMode" = "Vertex" }
    18.         Lighting Off
    19.         SetTexture [_MainTex] {
    20.             constantColor (1,1,1,1)
    21.             combine texture, constant // UNITY_OPAQUE_ALPHA_FFP
    22.         }
    23.     }
    24.  
    25.     // Lightmapped, encoded as dLDR
    26.     Pass {
    27.         Tags { "LightMode" = "VertexLM" }
    28.  
    29.         Lighting Off
    30.         BindChannels {
    31.             Bind "Vertex", vertex
    32.             Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
    33.             Bind "texcoord", texcoord1 // main uses 1st uv
    34.         }
    35.      
    36.         SetTexture [unity_Lightmap] {
    37.             matrix [unity_LightmapMatrix]
    38.             combine texture
    39.         }
    40.         SetTexture [_MainTex] {
    41.             constantColor (1,1,1,1)
    42.             combine texture * previous DOUBLE, constant // UNITY_OPAQUE_ALPHA_FFP
    43.         }
    44.     }
    45.  
    46.     // Lightmapped, encoded as RGBM
    47.     Pass {
    48.         Tags { "LightMode" = "VertexLMRGBM" }
    49.      
    50.         Lighting Off
    51.         BindChannels {
    52.             Bind "Vertex", vertex
    53.             Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
    54.             Bind "texcoord", texcoord1 // main uses 1st uv
    55.         }
    56.      
    57.         SetTexture [unity_Lightmap] {
    58.             matrix [unity_LightmapMatrix]
    59.             combine texture * texture alpha DOUBLE
    60.         }
    61.         SetTexture [_MainTex] {
    62.             constantColor (1,1,1,1)
    63.             combine texture * previous QUAD, constant // UNITY_OPAQUE_ALPHA_FFP
    64.         }
    65.     }  
    66.  
    67.  
    68. }
    69. }

    Could you help plz me to convert to shader forge?

    Thanks you.
     
    Last edited: Nov 2, 2016
  11. grogshotgames

    grogshotgames

    Joined:
    Aug 6, 2015
    Posts:
    76
    Hello,

    Two quick questions:
    1) Is it possible to make Shader Forge work with Spine materials?
    2) Is it possible to get an outline out of an sprite?

    Thanks!
     
  12. zhoazhiqing

    zhoazhiqing

    Joined:
    Nov 7, 2016
    Posts:
    6
    Hi.
    i need maker Terrain shader. but normal maps won't work.
    how to implement the tangents :(:(:(:(
    Thanks~
     
  13. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    484
    I've done it previously by using the same normal map reconstruction method, but with the terrain heightmap. But that was on an earlier release of 5.

    Beyond that, a Unity terrain should start as a flat plane with some easy normal, binormal and tangent vectors.
     
  14. zhoazhiqing

    zhoazhiqing

    Joined:
    Nov 7, 2016
    Posts:
    6
    Can you share your experience,I really need
     
  15. ATLAS-INTERACTIVE

    ATLAS-INTERACTIVE

    Joined:
    Mar 3, 2014
    Posts:
    1,295
    Hey Guys,
    I am working on a few water-y effects for a leaking area and partially-submerged, water damaged area.
    I found a few shaders on the Asset Store that do what I am looking for but no shader forge support and I would prefer to have that advantage of being able to edit them in SF.

    The effect I am looking for is something that was first supported in DirectX10 (first largely seen in Bioshock 1), where a mask or something else can be used to distort the texture behind it, simulating/faking the refraction caused by surface-flowing water.

    This can be found in this video:


    In this video, it is mainly seen on the floor and on the objects, where the "water" is refracting/warping/distorting the surface "behind" it.

    Does anyone know how I can achieve this in SF?
     
  16. Yughues_

    Yughues_

    Joined:
    Dec 27, 2013
    Posts:
    140
    Hi,

    I try to mimic a translucency (or SSS) effect using a specific texture, like in Marmoset 2.
    For some reason it's not a basic feature (like in UE4).

    Sans titre-1.jpg

    But I'm not a mathematician ; I don't really know where to dig (light direction is my only guess). My random tests with transmittance/Light Wrapping & else didn't worked out as intended.

    Can you help me, please ? =|


    (I have a really hard time to understand how to use the nodes about direction (light, normal, tangents etc), the website doesn't helped me)
     
  17. Augmented_Island_Studios

    Augmented_Island_Studios

    Joined:
    Feb 16, 2012
    Posts:
    58
    I might be wrong but I think one of the Shader Forge examples has this features, the vegetation one presents some 'fakey' translucency if i remember correctly.
     
  18. Yughues_

    Yughues_

    Joined:
    Dec 27, 2013
    Posts:
    140
    Yes and no. I used this foliage shader first but it doesn't work that much ; it's way too slight.
    I even tried to tweak it but without results. Even after reading the nodes description & so I haven't find something which helps me.
    That's why I'm seeking for help. =(
     
    Last edited: Nov 9, 2016
  19. Yughues_

    Yughues_

    Joined:
    Dec 27, 2013
    Posts:
    140
    I manage to fix the ugliness of the rendering but updating ShaderForge (but now I'm forced to make asset for Unity5.4 if I want to use the latest version of ShaderForge =/). Transmittance works better now but I keep trying to find a way to accentuate it, to make bushes look softer.


    Now my concern is for future assets some people might complain about the fact I made my assets for Unity 5.4 and not 5.0 or 5.1. (Yes I had complains for some previous assets made in 5.1 instead of 5.0) =|
     
  20. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    3,954
    Can't you make your shaders in a separate 5.4 project and copy them over to the 5.0 asset-creation-project? Is there anything in SF generated shaders that isn't backwards compatible? I'd have imagined it's only the asset itself that needs 5.4, didn't test it though.
     
  21. Yughues_

    Yughues_

    Joined:
    Dec 27, 2013
    Posts:
    140
    No, I can't. If I import the compiled shader from 5.4 to 5.1.1 it says ShaderForge needs 5.3 to work. =(
     
  22. Yughues_

    Yughues_

    Joined:
    Dec 27, 2013
    Posts:
    140
    It took me a night of thinking but I managed to do something. It's not perfect but better than pitch black shading.
    It uses the Translucency texture in Transmittance, LightWrapping and Diffuse AmbientLight.
    I attached the shader if you want to take a look & maybe find a better/more optmized way to do it. ^_^

    off.jpg

    on.jpg

    SF.jpg SFclose.jpg

    The Diffuse AmbientLight is not that useful but can be interesting to add a veeery slight effect.

    (the limited retro-compatibility remains annoying for me =/ )
     

    Attached Files:

  23. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    3,954
    Even if there is no Shaderforge installed in the project? I always thought the Shaderforge metadata is 100% crammed into a commented out textblock, so that unless you have Shaderforge installed in the project no thing should even know it's a Shaderforge shader. Or am I misunderstanding something? Have you tried just removing the SF metadata manually?
     
  24. Yughues_

    Yughues_

    Joined:
    Dec 27, 2013
    Posts:
    140
    The vegetation shader seems to use a script object which doesn't exist in older version.

    "undeclared identifier 'unity_ObjectToWorld' - d3d11 line 95" it says. =|
     
    Martin_H likes this.
  25. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    3,954
    Oh, I see. Guess then this kind of shader isn't the solution if you need a backwards compatible project. Maybe look at the vegetation shader in the free Lux shader package on the assetstore?
    https://www.assetstore.unity3d.com/en/#!/content/16000
     
  26. Yughues_

    Yughues_

    Joined:
    Dec 27, 2013
    Posts:
    140
    I have this asset too so I'll test it.
    I also have AFS but for this kind of bushes (dense/thick) it doesn't look nice.
     
  27. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    584
    Hi,

    is it possible to make a shader for the Projector Unity component? I had have to make by hand changes to this shader to achieve a marker on the uneven terrain. The Unity projector shader are under the Effects asset. This contains a blob shadow shader and a light shader. I took the light shader and modified it to get a non transparent marker. At all, the projector component is one of the possibilities to have something on uneven terrain without adding any additional meshes.
    I don't know that it is possible to give this shader a normal map an AO map a metallic map to also get a more detailed terrain animation. I would like to do this in shader forge, because I don't now how to write a shader by code.

    Thank you for your answers in advance .

    Hint: I tried to make a shader, but the shader itself did not follow (changing transforms position) the game object with the Projector component.

    bandicam 2016-11-11 12-23-56-165.jpg
     
  28. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    493
    Working on a custom Depth of Field shader that creates sharp bokehs the longer the distance is.
     
  29. aivan3d

    aivan3d

    Joined:
    Feb 27, 2014
    Posts:
    1
    Hello.

    I have some problems with uv tile node. I used some sprite sheet. In example you can see some error. I want see frame number 6 but it shows 0. This error occurs only in first frame in line at all sprite sheet.

    upload_2016-11-16_19-42-57.png
     
  30. Shiyao

    Shiyao

    Joined:
    Nov 27, 2013
    Posts:
    23
    Does anyone know how to rotate cubemap in horizontal?I want to create a skybox shader.
     
  31. Vladnes

    Vladnes

    Joined:
    Jul 5, 2014
    Posts:
    51
    Recently, I asked this question. I was then told that there are often problems with the lighting and positioning. Now that has changed this for the better?
     
  32. suifeng

    suifeng

    Joined:
    Nov 13, 2014
    Posts:
    2
    The link is invalid,could you update a new one? Thank you so mach!
     
  33. gfunk

    gfunk

    Joined:
    Mar 17, 2015
    Posts:
    23
    Hey guys, I hope you can help me with a seemingly simple issue.

    I want to overlay an emissive decal over a green texture and animate this emission from zero to bright red. However, the issue is that I can't get the red color because the red multiplies over the green and comes out orange. How should i blend these two green and red textures on top of one another and connect them to the emission slot so that red stays red and doesn't mix up with green underneath? I have tried every setting in the blend node. Hope I was clear... Any suggestion is much appreciated..
     
  34. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    484
    There should be a blend mode that does this. Premultiply I think.

    The problem you're getting is that green (010) + a red emissive glow (100) = bright yellow (110).

    The other thing you can do is instead of just adding the emissive color (blend add or screen or whatever) you actually do a proper blend to something that has both a solid color component (over-writing the green) and a glow (adding the red).
     
    gfunk likes this.
  35. gfunk

    gfunk

    Joined:
    Mar 17, 2015
    Posts:
    23
    Thanks for your answer, Jesus! However I couldn't find the blend mode you had in mind (there's no premult?). Could you please elaborate your last paragraph, seems you are on to something but I'm really just a rookie in SF :(... Thank you kindly..
     
    Last edited: Nov 29, 2016
  36. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    484
    Google search for alpha blended premultiply. It's the el dodgo good looking solution for bright things. It's not the 'correct' way to do things, but once you get the hang of it, it can be the fastest.

    What I was talking about in the second part was to try and overlay a second full material for the decal, including albedo (diffuse) AND emissive.

    So, assuming they all stacked on top of each other, they'd look like this:

    Emissive Green from decal
    Green shaded from decal
    Red base material from wall or floor or whatever


    That way none of the red can make it through and tint the green glow orange or yellow.
     
  37. kdm3d

    kdm3d

    Joined:
    Jul 20, 2012
    Posts:
    15
    Why not use a lerp node? use your emissive map as a mask on both your albedo and emissive slots.
     
  38. mangax

    mangax

    Joined:
    Jul 17, 2013
    Posts:
    294
    hello, am getting error >> invalid subscript 'boxMax' at line 162 (on d3d11)

    this is on latest unity official release 5.5
     
  39. RussellFincher

    RussellFincher

    Joined:
    Sep 30, 2012
    Posts:
    50
    I've created a shader that radiates stripes outward. I want to project it down from a player-controlled object (using Unity's blob shadow projector) so that it moves across the scene when the player moves (imagine like a spaceship with the stripes radiating out on the ground below it). But here you can see what happens when I move the projector object:



    It seems that since I used a UV Coordinates node in Shader Forge to create the radiating pattern that it is constrained to the surface's UVS, instead of moving along the surface like a regular blob shadow would:



    I can put a regular blob shadow material on this projector and it works as expected:



    Can anyone think of a way that I could make it so this projected material can move across the surface below instead of being constrained to the surface's UVs?
     
    Last edited: Dec 3, 2016
  40. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    3,954
    Maybe take a look at the code of the working shadow projector shader and see if there is anything special related to projectors. Does Shaderforge have any preset for projectors? If not, chances are you can't make it with Shaderforge I'd imagine. I'm not sure though.
     
    RussellFincher likes this.
  41. RussellFincher

    RussellFincher

    Joined:
    Sep 30, 2012
    Posts:
    50
    One thing I have noticed is that I can add a Vector 2 to the first node to create a UV offset (which works in-game). If I could figure out a way to feed the world position of the projector into it (or screen position if it's top-down) then maybe I can move it that way. So far the World Position and Screen Position nodes aren't giving me anything. I don't know how they work just yet.



    Edit: Yeah those won't work at all. I think I just need to feed the actual screen space coordinates of the projector into Shader Forge, remap them, and add them to the UV coords like I am here. Gotta figure out how to get those coordinates into Shader Forge.

    Edit2: Aaand I just learned about using Global Variables in Shader Forge.
     
    Last edited: Dec 3, 2016
    hopeful and Martin_H like this.
  42. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    3,954
    Sounds like you are doing some complex stuff there. I'd love to see the final result, would be cool if you post it here when you are done.
     
    hopeful likes this.
  43. RussellFincher

    RussellFincher

    Joined:
    Sep 30, 2012
    Posts:
    50
    How do you give a value, or any node, a name (or "property label" or "internal label")? I'm trying to make Value nodes into global variables so I can control them via script but just can't figure out how.

    I'm not getting the dropdowns that are in the docs, I'm assuming because my value nodes have no names.
     
    Last edited: Dec 3, 2016
  44. The-Britain

    The-Britain

    Joined:
    Mar 31, 2015
    Posts:
    714
    Man, if it wasn't so close to Christmas I would have to give this a buy. This extension looks fantastic!
     
  45. CraigGraff

    CraigGraff

    Joined:
    May 7, 2013
    Posts:
    40
    Are there any plans to support instancing shaders? Or is this already included somewhere that I haven't noticed?
     
  46. AussieGenesis

    AussieGenesis

    Joined:
    Nov 4, 2013
    Posts:
    2
    Hello all,

    There was a Shallow Ocean shader provided by ninja on page 65? of this thread that is dead.
    I've recreated it the best I can from the Ocean Shader provided in the Unreal Forums.

    There are some tweaks that need to be made as I wasn't 100% on what some of the nodes translated to in ShaderForge from UE.

    https://ufile.io/634151

    The file will expire in 30 days from today.

    Reference Node Graph Image from UE Shader;
     
    hopeful and Martin_H like this.
  47. kdm3d

    kdm3d

    Joined:
    Jul 20, 2012
    Posts:
    15
    In the top left of the editor, there's a settings dropdown. Turn on variable names. I will add though that global variables are made to control multiple shaders with the same value through code. You can still script values if they are local variables the same way you would any other.
     
  48. elementals

    elementals

    Joined:
    Mar 16, 2013
    Posts:
    3
    replace this in shader code
    d.boxMax[0] = unity_SpecCube0_BoxMax;
    d.boxMin[0] = unity_SpecCube0_BoxMin;
    d.probePosition[0] = unity_SpecCube0_ProbePosition;
    d.probeHDR[0] = unity_SpecCube0_HDR;
    d.boxMax[1] = unity_SpecCube1_BoxMax;
    d.boxMin[1] = unity_SpecCube1_BoxMin;
    d.probePosition[1] = unity_SpecCube1_ProbePosition;
    d.probeHDR[1] = unity_SpecCube1_HDR;

    with this
    #if UNITY_SPECCUBE_BLENDING || UNITY_SPECCUBE_BOX_PROJECTION
    d.boxMin[0] = unity_SpecCube0_BoxMin;
    d.boxMin[1] = unity_SpecCube1_BoxMin;
    #endif
    #if UNITY_SPECCUBE_BOX_PROJECTION
    d.boxMax[0] = unity_SpecCube0_BoxMax;
    d.boxMax[1] = unity_SpecCube1_BoxMax;
    d.probePosition[0] = unity_SpecCube0_ProbePosition;
    d.probePosition[1] = unity_SpecCube1_ProbePosition;
    #endif
     
    RuFiOHHHHH likes this.
  49. Fishypants

    Fishypants

    Joined:
    Jan 25, 2009
    Posts:
    444
    I have an issue I am trying to solve, I basically want to create something similar to the DepthBlend Node, but essentially what I am looking for is the World Position of the pixel behind the current pixel. Right now the DepthBlend node gives me the distance of the pixel as a scalar value, so how would I find the World Position of it instead? Is there a way in Shader Forge to do this?
     
  50. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    3,954
    Maybe scale the view direction vector with the depthblend result and add it to the worldspace position of the current vertex? What is the visual end goal?