Shader Forge - A visual, node-based shader editor

Thanks Chaoss!

About the new nodes;
Assuming you have two vectors, a and b (The black ones in the image), you get get the resulting vectors a1 and a2 using Vector Projection and Vector Rejection.

The Vector Projection node gets you the green vector, a1
The Vector Rejection node gets you the red vector, a2

Ok, I created a flow refraction shader using the example refraction shader as a base. Itā€™ll flow the texture, refract anything behind it. Iā€™ve it designed to support a flow texture, a refraction texture, flow speed, flow direction, flow emission, refraction intensity, and you can add color to it.

With that said onto my issue. I canā€™t seam to get specular to work. I want to be able to add a ā€œshineā€ to it, but neither gloss or specular seam to do anything. I think it has something to do with the refraction as once I sent refraction intensity to 0 itā€™s ok. Any ideas how to go about fixing this? Attached is my current shader progress.

1480902ā€“81993ā€“$ShaderForgeFlowRefraction.shader (14.7 KB)

I tried running it, but it seems to work fine for me, with reflections and all. Are you sure your scene and preview is set up correctly? Lights are on etc?

Itā€™s just specular that wonā€™t seam to do anything. Iā€™m using DX11, Deferred Lighting, Linear Color Space, and 1 light next to it. Iā€™ve tried upping the specular a ton, adding a slider to it, adding a color to it. Changing it just doesnā€™t seam to do anything. If I set the refraction intensity to 0 then it works.

Iā€™ve found a pretty critical showstopping bug. on ANY shader I make none of my properties show up and the shader is bright pink, even with just a diffuse slot. This ShaderForge is a clean install.

In my prototype space I was able to get a custom ibl shader going :wink: Thanks!

Known issue. Has been fixed and will be released in the next version.

For the time being a workaround I found was to setup a property thatā€™s needed for evaluating the defuse, compile the shader. Those properties seem to show up in the properties window most I the time. You should then be able to safely break the link and use it where you actually want.

That looks awesome! Looking forward to seeing what comes from you now that youā€™ve got Shader Forge :slight_smile:

Deferred is the culprit, I believe. SF doesnā€™t make deferred passes at the moment, which means some shaders canā€™t be rendered properly. Transparency and DX11 tessellation being the two known cases where things break so far. Switch to forward and it should work :slight_smile:

Like DSebJ said, itā€™s a known issue, but has been fixed in 0.18, which is now in Unityā€™s hands waiting to be approved!

Very nice one!

Is there a way to recreate this shader in ShaderForgeā€¦

The shader has the road mesh plain appear flush with the terrain, but without z-fighting. What I have managed to get is a road shader where the further to the camer view it is the higher up the road becomes, The 2 main problems I have are the roads appear to be ā€˜aboveā€™ the terrain, even if itā€™s just by a tiny bit, the other issue is anything on the road such as players feet or dropped weapons ā€˜sinkā€™ into the road some. If i push the road down any more than it is right now t z-fights

I completely forgot the offset values! (Offset -0.5, -275)
Iā€™ll implement this in Beta 0.19. Could you request it on the feedback page? :slight_smile:

What do you mean by the offset values?

Iā€™ll create the topic then, donā€™t worry!
The reason that shader works is because it has an offset. This is the critical line:

Offset -0.5, -275

SF currently doesnā€™t support that, but it could be added trivially :slight_smile:
Technical details, in case you wonder: Unity - Manual: ShaderLab: commands

Ah awesome, yeh if you could add that itā€™d be much appreciated! :slight_smile:

Refraction tutorial will be?

Amazing asset! Iā€™m curious about the deferred lightingā€¦specifically transparency (your vegetation shader to be exact). As you mentioned, this has issues in deferred mode. Is this simply not possible, or a feature that is still in the works?

Thanks!

Possibly! Although there is a refraction shader included in the example assets :slight_smile:

Thanks!
SF doesnā€™t render deferred passes, so all shaders created in SF are rendered in forward rendering, regardless of your render pipe setting.

So, what basically breaks (from what I can see so far): Alpha blending, alpha clipping and Tessellation.
It is planned, but it might take a while to get it sorted out, because deferred works in completely different ways!

Iā€™m not sure thatā€™s the issue. Transparency seams to be working fine. Everything is except Specular. I even changed to forward rendering (which I canā€™t as my game doesnā€™t look good with it) and thereā€™s still no Specular. I wonder if this is just an issue with the Normal being generated by my texture.

You might need to normalize your normal direction before it goes into the normal input of the main node

Really love SF so far! It needs a lot of convinient features for managing big graphs(collapsable compounds, node instances, labeled fields, wire routing points, etc.) but since its still a beta i am sure the future will bring some of these. The functionality is already outstanding :smile: Like already mentioned i also hope that we can author shaders that work in deferred mode at some point.

I would be interested to learn more about the PBL and especially about what could eventually break the energy conservation. Does the energy conservation happen in the main node and everything we plug into it will be automatically handled correctly or do we need to take care about some things? Another question i have is, what is the best way to get custom fresnel curves for reflectivity:

my idea is to have a second fresnel node inverted and added on top of the first fresnel node before multiplying it onto the specular color/map. Is that a good way to do it or are there better ways?

However, love the tool and already made a neat PB IBL multi purpose shader in no time: