I want to make this effect in my game but i have no idea about where to start. I tried some shadergraphs, shaders, post processing effects but none of them worked. Can someone give me an idea about how can i achieve this ?
That’s like saying “I tried code but it didn’t work.” This doesn’t help us if you don’t tell us more.
You are right sorry.
First i tried to convert this terrain scanner to what i want but i couldnt achieve. I’m not very familier with shader graphs. This terrain scanner only detects edges and colourize it.
But my problem is i have no idea about where to start. Should i start with shader graph ? Or is this about post processing or materials. I just need a starting point then i can do some research.
Hi @kmandacidev,
this is somehow similar to this question I recently addressed.
To @Murgilod 's point, you first need to break down what you want and how to achieve it from a graphics standpoint, then pick the tools to implement the solution.
In the tutorial you shared, @GabrielAguiarProductions shows how to use a Particle System to spawn one sphere particle and make it grow over time, and use a Shader Graph Material Shader that uses Depth Buffer sampling to tell if there’s anything close by.
ShaderGraph allows you to author shaders to be used in many areas, such as Materials, Decals and Post-Processing.
Since you want this to be applied to the whole scene, I’d suggest using either a Decal for localized effect, or Fullscreen Post-Processing like in that other post I replied to.
Here’s an example using a Decal Projector.
And the Shader Graph
If you’re using URP, you need to add a Decal Renderer Feature to your URP Renderer. If you’re using HDRP, you just need to enable Decals in the HDRP Asset.
Notes on that Graph:
- The Distance between the Object position (Decal Projector Transform) and Abs. World Position (position of the pixel) is what you need to start with. It’s all just vector math afterward.
- DDX and DDY nodes can be used to make the outline constant in screen space
Hope this helps.
Thanks for your time and reply. I will try this and let you know.
First, when i try to implement your shader graph, it doesnt look like yours. I dont see any difference between mine and yours.
Secondly, i wanna recreate the visual effect of that game “Perception”. I guess its something about Gameobject’s occlusion texture’s and its properties. Do you have any idea about how can i recreate that visual. I want my players see the world like on the “Perception” game.
You only showed a portion of the graph and you didn’t show how it doesn’t look the same.
I cannot explain myself and my problem. Maybe because of language barrier. What i want is i want my gameobjects to look like on the “Perception” game. This shader graph is not making this am i right ? Im trying a fresnel effect shader graph right now. After completing it i will reply this post again and explain my problem with screenshots and scripts.
When i write its not the same i mean its not making my scene like “Perception” game. My question is how can i achieve a visual like that game. Even this shader graph works its not gonna achieve what i want. I mean my character should see his environment like on the gameplay video. The gameobject’s edges should highlight.
My opinion is i should have a x radius sphere around my character. And the gameobjects in this sphere should look like on the video. Dont i need a shader graph makes gameobjects looks like in the “Perception” game ?. Can i achieve it with fresnel effect ? But how can i do this ?
Ok, let me explain a bit.
It is hard to help you because your question is very vague. There is a lot of effects and we don’t know what exactly you are refering to. Also FredMoreau gave you hint, not exact solution to your problem, so it can’t work by itself.
From my understanding you want the ripple effect as whole, including blue aura, so let me give you some breakdown.
You already have some examples about ripple effect, you most likely need to combine masks of passive “light” bubble and add riple on top of that. There are two ways for this effect:
- Create shader that will be used by all or almost all objects on the scene and get data from global shader variables to know where the riple should be etc.
- Add postprocess as already suggested doing similar stuff - you would just render your scene and lerp to black color where the riple/bubble fades.
When it comes to blue aura, I think it works in similar way as Screen Space Ambient Occlusion (SSAO), but instead of making things dark, the (AO) texture is used in postprocess to make things “glow”.
However, it is combined in some way with fresnel effect I think. Additional thing is that there is some kind of edge detection, to make certain edges very bright, but this time I think edge mask is pre-baked into textures. It probably takes the ripple/light bubble as mask then multiply by this edge mask from texture, and then combine with this ambient occlusion glow.
First of all, thanks for your detailed response. This is inspired me. Let me explain more.
In my game my character will be blind and hyper sensitive to sounds, voices etc. I want my character to see the world with sounds.
When anything makes sound, noise in my game, there should be this blue aura. Lighting around itself and my character gonna see it.
And passively my character be able to see his around for like 5meters diamater.
So i will create a shader graph, whick makes objects edges glow, center darker like “Perception” game. And then im gonna check is this material is in my visibility area. If it is it is gonna use this shader, if not it is gonna be black.
And then for blue aura i will try what you said. And than if a gameobject is in this blue aura, it is gonna be visible, if not it is gonna be black. And finally, when something makes noise, i will just instantiate that blue area on the source of noise so the gameobjects in its area gonna be visible.
That makes sense. Thank you again. I will let you know.
I cant even make a blue aura with shader graph. This is my 3rd year with Unity Engine but i dont know how to use shader graphs. Thank you all for you efforts but im giving up. I cannot achieve this with this shader graph knowledge. I should start from basics i guess.
Yes, you should. You don’t know how to approach fairly basic things in Shader Graph and should start learning from the beginning, giving yourself a fundamental skillset to work with instead of trying to create complex effects from the start.
Yes. I thought i can handle it but it doesnt look like coding. I can code well but suck at shader graph. Thanks all for your time and replies.
I agree that you should start with smaller effects, but something to keep in mind is that what you see in that game is not a single “effect”.
Many times, in order to build a complex system, you have to split it in pieces that can work together. From what I can see, that game has some clearly different parts:
- The main post-processing effect. You can do this with Shader Graph
- “Sound waves” particle system, emitting from certain objects in the scene. You can do this with VFX graph or Shuriken (Particle System).
- Highlight material, applied to some objects, light the door frames. You can do this with Shader Graph, but in a different graph, not with the post processing.
The most difficult of those is probably the post-processing. I recommend that you use the deferred renderer. You can start sampling from the camera depth and normal textures and then apply some techniques. You can look into:
- Fresnel: To highlight the edges
- SSAO: which is similar to what they do to get that smooth outlines
- The scanner effect you mentioned before.
Good luck with your learning. Don’t be discouraged if you are not able to achieve this at the moment. That effect was probably done by someone with experience, and it probably took a long time to get the desired look.
Thanks for your reply. I noted your comment. After do some learning basic stuff, i will look onto this.