Yes, I'm sorry for not explaining.
I need to apply this to RGB values, or values of any kind. Like you'd use a floor/ceil/trunc function, for example.
Basically I'm trying to create a sort of a posterized shader with soft transitions between the values/hues, and I thought this would be a good way to achieve this with SF.
Ideally I would also have a way to scale the "smoothing" of the angles/corners, scaling it between something that's very close to a floor function and something that's very smooth and wavy.
Is it at all possible to include IBL in a custom lighting shader, using unity 5's new sky system/reflections?
I toyed with adding cubemaps to the existing hierarchy, but due to lack of knowledge, I don't know how to incorporate them properly.
Also I'd like it to be integrated with unity's sky system, which I have no idea how to achieve (basically make it behave like a PBR preset does, only through custom lighting).
I'm looking for any help regarding creating a very specific shader using SF. The effect I'm looking for is present in Telltale's Wolf Among Us (See bricks in background).
The areas in light would be one texture, the areas in dark would be another; the light would not make the mesh dark, just use the lighting info to change the texture. I've created two textures, one "lit texture" and one "shadow texture". I was thinking a hard blended ramp between the two textures would work, but I'm not sure how to have that effected by spotlights
I just wanted to say that this tool is awesome! It has made my life much easier working with Unity, thank you for the tool. I sold it to my team lead by saying that 'it'd take me a few days to find the functions to get that kind of effect, or it's a one click solution in Shader Forge. You mind if we get a copy?'
On a side note, I've been working on a translucent glass shader, but it's not playing well with dynamic shadows using just the opacity output - shadows treat it like it was solid. Is there a checkbox I'm missing?
Shader Forge 1.17 introduces matrices as a data type, and a matrix multiplication operation. Which means
You can now create shaders that render lighting for Unitys Shuriken particles correctly. Since Unity particles render in Camera space instead of World space, regular light attenuation doesnt work properly. The shader needs to know the particles position in World space. So you put this script on your camera
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(Camera))]
public class CameraToWorld : MonoBehaviour
{
private Camera myCamera;
void Start () {
myCamera = GetComponent<Camera>();
}
void OnPreCull() {
Shader.SetGlobalMatrix("_Camera2World", myCamera.cameraToWorldMatrix);
}
}
Shader Forge's new Global Matrix 4x4 data type can see the _Camera2World matrix. Multiply your vertex positions by this matrix to put them back into world space. Now you can create whatever custom lighting you want. This shader uses point lights for alpha-blended particles, suitable for smoke or clouds. Note that Shader Forge cant see the lights Range parameter so you have to put that into the material manually.
Hi guys. Hope someone could help me with this. I'm busy creating a repeating animated texture(caustic). I worked off this, which works, but as soon as you try scale the animated texture(by using multiply with the UV coord) then it breaks. (parts work and others have offsets causing them to jitter)
I've attached the shader and the caustic texture of size 4 x 8.
Settings on script will be 0.5(global_uvScale), [4,8,1,0](SeqSettings).
Any help would really be appreciated!
So I'm hoping someone could help me with this shader I'm trying to do.
I'm trying to get this effect.
On vertex colors though, where between vertexes, if there's a different color on each one it'll blend like that except with custom texture patterns.
I have this so far.
I'm just wanting the noise filter to show up between vertexes of different colors. And the black of the texture will be one color and the white will be the other.
If anyone has any pointers I'd be much appreciative.
Here's a simple pattern that I've been playing with - instead of using Sin or Frac to make time-based offsets, I bake the function into a texture, then offset it with a UV pan node.
The nice thing about it (in addition to not having to calculate sin) is that you can put whatever function you want into it - easing in or easing out, blinks followed by slow waves, whavever.
Added node: HSV to RGB
Added node: RGB to HSV
Added node: Inverse Lerp
Added node: UV Tile - useful for getting sub-UVs for spritesheets/tilemaps)
Added node: Face Sign
You can now use the stencil buffer
You can now select ArcTan2 range: [-Pi to Pi], [-1 to 1], [0 to 1] and [0 to 1 Wrapped]
You can now tag Color fields as HDR, making the inspector use a HDR color picker instead
The shader inspector now contains all info from Unity's default shader inspector
Double-sided shaders no longer have false-positive facing artifacts along edges
Fixed a bug where lights weren't masked by fog
Fixed a bug where you couldn't undo the dot product type setting
I agree. It is also nice to see a package like this that is kept up to date so well. Some of my other asset store purchases have become support nightmares as new unity builds are released.
I cannot get the ligthmap to work or be available on the checkbox, help?
The lightmap is getting baked, but how do I get it to show with the material? I'm not doing anything different than blending some lerps together. I tried naming MainTex etc but no success. Any idea?
edit: I noticed that when I'm on unlit I cant use it? Is that correct? Is there a way to create an unlit version and still use lightmap?
Quick question, is there anything related to UDK's DeriveNormalZ available? If not, how would I construct a correct tree to efficiently calculate the blue channel from R and G? Would this even make sense on mobile platforms?
Quick question, is there anything related to UDK's DeriveNormalZ available? If not, how would I construct a correct tree to efficiently calculate the blue channel from R and G? Would this even make sense on mobile platforms?
I was trying to create a refractive material for particles, for example to use them as "black hole", fire distortion or other magic FX. I once made it using classical shader programming, but IIRC that was a heavy modification of an example written by someone else and can't remember who, or maybe I did it from scratch, I can't remember. Probably something inbetween, picking different parts from different shaders I have no memory of, I was learning.
Is it possible to obtain such effect in Shader Forge? I'd like to have a texture to "blend" the particle distortion out in a circular manner, and have vertex alpha to control the amount of blending (1: totally distorted, 0: transparent)
Why is it pure black if I set it to be alpha blended? Why isn't the refraction or the alpha mask showing onto the cube?
I'd like such distorted particles to be able to overlap one onto each other.
I know it's a bit processor intensive (different grabpasses) but I won't be using many of them.
Hey guys,
I couldn't find any resources to explain how to handle the refraction effect...
Can anyone could give me a link, or briefly explain me ?
Thanks a ton ;-)
I was trying to create a refractive material for particles, for example to use them as "black hole", fire distortion or other magic FX. I once made it using classical shader programming, but IIRC that was a heavy modification of an example written by someone else and can't remember who, or maybe I did it from scratch, I can't remember. Probably something inbetween, picking different parts from different shaders I have no memory of, I was learning.
Is it possible to obtain such effect in Shader Forge? I'd like to have a texture to "blend" the particle distortion out in a circular manner, and have vertex alpha to control the amount of blending (1: totally distorted, 0: transparent)
Why is it pure black if I set it to be alpha blended? Why isn't the refraction or the alpha mask showing onto the cube?
I'd like such distorted particles to be able to overlap one onto each other.
I know it's a bit processor intensive (different grabpasses) but I won't be using many of them.
Could anyone please help me?
Thanks to anyone willing to help!
Make sure the console doesn't have any warnings about the fact that the shader isn't alpha blended. Also, the alpha channel of that texture might be fully white, making it fully opaque. You'll also want to make sure Z/depth write is off, otherwise the grab pass will just grab nonsense
Make sure the console doesn't have any warnings about the fact that the shader isn't alpha blended. Also, the alpha channel of that texture might be fully white, making it fully opaque. You'll also want to make sure Z/depth write is off, otherwise the grab pass will just grab nonsense
I took again the bundled refraction shader and tweaked it until I reached something which is close to the intended result, but not yet perfect.
Here's the node tree:
The Alpha channel just opacizes the effect making it blend to black. I was expecting it to give a smooth blend between the refracted zone and the rest of the scene.
Also, as particles overlap, they seem to cut out a square all around them, ruining the effect.
I also can't get rid of the shadow from the shader.
Is it possible to fix this or find a solution to make such shader work with Shader Forge?
I have a question about transparency mode. The shadow on ground does not fade as opacity changes. it remains the same brightness(black) when opacity changes from 1 to 0. When using standard shader, the shadow strength fades with opacity.
SO i'm toying with shader forge for a while, but don't understand how to set up the pot effect shader in practice? any example? step by step instruction? I find nothing by googling
I took again the bundled refraction shader and tweaked it until I reached something which is close to the intended result, but not yet perfect.
Here's the node tree:
The Alpha channel just opacizes the effect making it blend to black. I was expecting it to give a smooth blend between the refracted zone and the rest of the scene.
Also, as particles overlap, they seem to cut out a square all around them, ruining the effect.
I also can't get rid of the shadow from the shader.
Is it possible to fix this or find a solution to make such shader work with Shader Forge?
Hey as far as the shadows go that might be under the renderer tab on your particle system. make sure the cast shadows box is unchecked. Also assuming you want to control the alpha through your particle, plug your vertex color alpha directly into the alpha channel.
Sorry I keep adding on. You should also multiply the vertex color alpha by a radial gradient to get the fall off you are looking for and plug that in to your alpha channel. Hope this helps
SO i'm toying with shader forge for a while, but don't understand how to set up the pot effect shader in practice? any example? step by step instruction? I find nothing by googling
First off - SF isn't really made for post effects in general, so the workflow for it isn't very smooth I'm afraid. If it disappoints you can always get a refund
The issue is that it requires a C# side to it as well, so you get a component you can attach to a camera in order for it to work. At least if you want it to work like Unity's post effects. So have a look at how they set their C# components and their shader up. I imagine the shader is quite simple in many cases, especially for things like color correction.
Otherwise I recommend starting with the post effect preset, then using the SceneColor node and the SceneDepth node to make interesting things!
Okay I'll do the effort with the c#. I thought there was some tools to simplify it. So far whatever I tried don't seem to yield any result with the visualization. And I don't understand the node within the post process (why there is vertex node). I have seen people do past effect with it so I assume I could easily do the same.
Basically I'm trying as a start to just access the screen color and redraw it verbatim. I just have brown color on the visualization so far.
What I want to achieve in post process is really simple, I just want to sample 4 pixels values (+ or -) around the current fragment (at slider distance, eventually pondered by other data like depth or a mask texture) then choose the max luminosity value for the current fragment. I had a prototype for this effect on strumpy with simple texture.
I just want to see if its possible.
However shader forge is still cool for usual shader editing, so no refund
Does anyone have an idea to how I can mask out the IBL contribution from a PBR shader?
I'm trying to create a shader that makes everything completely black above/below a certain height in world space. So the shader would behave in a standard way, but starting from a certain height, it would be completely black.
I currently make the height calculation and multiply every relevant contribution by it, but since reflection from the IBL is handled outside the shader, I can't remove it.
Hi, so trying to make my first shader here. Looking for information on how to go about making custom specular highlights independent of lighting environment, usually when object is rotated.
Replies
Thanks!
But that's pretty much how it is done when you want to multisample a texture asset in SF. Can we see your graph/tree?
Hey man all you need to do is to change the drop selection under the UV node
I'm trying to find a function that outputs a graph like this:
Kinda like a floor, but with "softened" angles.
I'm no mathematician, but for some reason that feels like an impossible thing to get.
Is it?
I need to apply this to RGB values, or values of any kind. Like you'd use a floor/ceil/trunc function, for example.
Basically I'm trying to create a sort of a posterized shader with soft transitions between the values/hues, and I thought this would be a good way to achieve this with SF.
Ideally I would also have a way to scale the "smoothing" of the angles/corners, scaling it between something that's very close to a floor function and something that's very smooth and wavy.
a = number of steps
b = sharpness
it runs into problems with a "sharpness" value below 15.
It's not bad actually. Works pretty well. Thanks a lot
Is it at all possible to include IBL in a custom lighting shader, using unity 5's new sky system/reflections?
I toyed with adding cubemaps to the existing hierarchy, but due to lack of knowledge, I don't know how to incorporate them properly.
Also I'd like it to be integrated with unity's sky system, which I have no idea how to achieve (basically make it behave like a PBR preset does, only through custom lighting).
http://forum.unity3d.com/threads/using-ggx-instead-of-blinn-phong.323827/ found this post and wanted to know if shader forge will work ok on my project.
thanks!
https://twitter.com/JoachimHolmer/status/615791983819231232
Not using GGX yet, but, perhaps in the future!
http://www.u3d.as/6cc
The areas in light would be one texture, the areas in dark would be another; the light would not make the mesh dark, just use the lighting info to change the texture. I've created two textures, one "lit texture" and one "shadow texture". I was thinking a hard blended ramp between the two textures would work, but I'm not sure how to have that effected by spotlights
Any help would be great, thanks!
On a side note, I've been working on a translucent glass shader, but it's not playing well with dynamic shadows using just the opacity output - shadows treat it like it was solid. Is there a checkbox I'm missing?
You can now create shaders that render lighting for Unitys Shuriken particles correctly. Since Unity particles render in Camera space instead of World space, regular light attenuation doesnt work properly. The shader needs to know the particles position in World space. So you put this script on your camera
Shader Forge's new Global Matrix 4x4 data type can see the _Camera2World matrix. Multiply your vertex positions by this matrix to put them back into world space. Now you can create whatever custom lighting you want. This shader uses point lights for alpha-blended particles, suitable for smoke or clouds. Note that Shader Forge cant see the lights Range parameter so you have to put that into the material manually.
Inspired by this https://gist.github.com/Farfarer/158b23f694c2c995f93e
You could do this way too, just load the uv set 0 and multiply values to change the detail map. This way you don't mess with the lightmap uv set.
I've attached the shader and the caustic texture of size 4 x 8.
Settings on script will be 0.5(global_uvScale), [4,8,1,0](SeqSettings).
Any help would really be appreciated!
mmm...can't seem to upload the shader
Any help or just pointing into a direction would help. Thanks!
I'm trying to get this effect.
On vertex colors though, where between vertexes, if there's a different color on each one it'll blend like that except with custom texture patterns.
I have this so far.
I'm just wanting the noise filter to show up between vertexes of different colors. And the black of the texture will be one color and the white will be the other.
If anyone has any pointers I'd be much appreciative.
The nice thing about it (in addition to not having to calculate sin) is that you can put whatever function you want into it - easing in or easing out, blinks followed by slow waves, whavever.
[edit]
... Oh, I see - transmission has nothing to do with backfaces... Hmm. Can one independently shade backfaces?
Added node: HSV to RGB
Added node: RGB to HSV
Added node: Inverse Lerp
Added node: UV Tile - useful for getting sub-UVs for spritesheets/tilemaps)
Added node: Face Sign
You can now use the stencil buffer
You can now select ArcTan2 range: [-Pi to Pi], [-1 to 1], [0 to 1] and [0 to 1 Wrapped]
You can now tag Color fields as HDR, making the inspector use a HDR color picker instead
The shader inspector now contains all info from Unity's default shader inspector
Double-sided shaders no longer have false-positive facing artifacts along edges
Fixed a bug where lights weren't masked by fog
Fixed a bug where you couldn't undo the dot product type setting
Yep!
As of 1.18 it's trivially done using the Face Sign node and a lerp node
Very nice work, and thanks for the guide!
Perhaps I should implement this into Shader Forge natively?
The lightmap is getting baked, but how do I get it to show with the material? I'm not doing anything different than blending some lerps together. I tried naming MainTex etc but no success. Any idea?
edit: I noticed that when I'm on unlit I cant use it? Is that correct? Is there a way to create an unlit version and still use lightmap?
Cheers
You can do it this way:
Z = sqrt( 1 - (X * X + Y * Y) );
X and Y are the red and green channels.
I was trying to create a refractive material for particles, for example to use them as "black hole", fire distortion or other magic FX. I once made it using classical shader programming, but IIRC that was a heavy modification of an example written by someone else and can't remember who, or maybe I did it from scratch, I can't remember. Probably something inbetween, picking different parts from different shaders I have no memory of, I was learning.
Is it possible to obtain such effect in Shader Forge? I'd like to have a texture to "blend" the particle distortion out in a circular manner, and have vertex alpha to control the amount of blending (1: totally distorted, 0: transparent)
Why is it pure black if I set it to be alpha blended? Why isn't the refraction or the alpha mask showing onto the cube?
I'd like such distorted particles to be able to overlap one onto each other.
I know it's a bit processor intensive (different grabpasses) but I won't be using many of them.
Could anyone please help me?
Thanks to anyone willing to help!
I couldn't find any resources to explain how to handle the refraction effect...
Can anyone could give me a link, or briefly explain me ?
Thanks a ton ;-)
Make sure the console doesn't have any warnings about the fact that the shader isn't alpha blended. Also, the alpha channel of that texture might be fully white, making it fully opaque. You'll also want to make sure Z/depth write is off, otherwise the grab pass will just grab nonsense
I took again the bundled refraction shader and tweaked it until I reached something which is close to the intended result, but not yet perfect.
Here's the node tree:
The Alpha channel just opacizes the effect making it blend to black. I was expecting it to give a smooth blend between the refracted zone and the rest of the scene.
Also, as particles overlap, they seem to cut out a square all around them, ruining the effect.
I also can't get rid of the shadow from the shader.
Is it possible to fix this or find a solution to make such shader work with Shader Forge?
Here's a link with the shader and a test texture:
https://dl.dropboxusercontent.com/u/45747146/Particle%20Refraction%20Shader%20and%20Assets.zip
Hey as far as the shadows go that might be under the renderer tab on your particle system. make sure the cast shadows box is unchecked. Also assuming you want to control the alpha through your particle, plug your vertex color alpha directly into the alpha channel.
Sorry I keep adding on. You should also multiply the vertex color alpha by a radial gradient to get the fall off you are looking for and plug that in to your alpha channel. Hope this helps
First off - SF isn't really made for post effects in general, so the workflow for it isn't very smooth I'm afraid. If it disappoints you can always get a refund
The issue is that it requires a C# side to it as well, so you get a component you can attach to a camera in order for it to work. At least if you want it to work like Unity's post effects. So have a look at how they set their C# components and their shader up. I imagine the shader is quite simple in many cases, especially for things like color correction.
Otherwise I recommend starting with the post effect preset, then using the SceneColor node and the SceneDepth node to make interesting things!
Okay I'll do the effort with the c#. I thought there was some tools to simplify it. So far whatever I tried don't seem to yield any result with the visualization. And I don't understand the node within the post process (why there is vertex node). I have seen people do past effect with it so I assume I could easily do the same.
Basically I'm trying as a start to just access the screen color and redraw it verbatim. I just have brown color on the visualization so far.
What I want to achieve in post process is really simple, I just want to sample 4 pixels values (+ or -) around the current fragment (at slider distance, eventually pondered by other data like depth or a mask texture) then choose the max luminosity value for the current fragment. I had a prototype for this effect on strumpy with simple texture.
I just want to see if its possible.
However shader forge is still cool for usual shader editing, so no refund
I'm trying to create a shader that makes everything completely black above/below a certain height in world space. So the shader would behave in a standard way, but starting from a certain height, it would be completely black.
I currently make the height calculation and multiply every relevant contribution by it, but since reflection from the IBL is handled outside the shader, I can't remove it.