Jump to content
  • Advertisement

Crystals types with fancy particles effects

This shows how each type of crystals are being displayed in-game.

Each type has its own unique particle effects.

These are supposed to represent a flame (red crystal), fireflies (green crystal) and drops of water (blue crystal).

The actual shape of these particles aren't yet finished, so in the meantime, I'm using the Unity default particle shape as a placeholder.



From the album:

Vaporwave Roguelite

  • 85 images
  • 0 comments
  • 9 image comments


Recommended Comments

Hi, on another entry I asked you about the shader you are using, and you pointed me that you basically used a modified version of an AVdistortion from shadertoy. I wanted to ask you how you manage to implement it, i found some tools and guides to use the shader in Unity but failed to make it work. I dont really know about shaders, first i tought they were used on cameras only, but now im not sure if they are only for materials. Anyways, i couldnt make it work, i was wondering if you could give me a hint or two? Thanks in advance, your game looks lit.

Edited by Antonio Schwuchow

Share this comment


Link to comment
On 4/8/2019 at 8:32 PM, Antonio Schwuchow said:

Hi, on another entry I asked you about the shader you are using, and you pointed me that you basically used a modified version of an AVdistortion from shadertoy. I wanted to ask you how you manage to implement it, i found some tools and guides to use the shader in Unity but failed to make it work. I dont really know about shaders, first i tought they were used on cameras only, but now im not sure if they are only for materials. Anyways, i couldnt make it work, i was wondering if you could give me a hint or two? Thanks in advance, your game looks lit.

Sure!

So the trick is to go line by line and slowly translate from GLSL to HLSL.

It was a mater of really understanding how the shader work and cutting the unwanted parts.

If you didn't know, shaders are pieces of code that describes the way geometries are drawn. Usually there's a couple of functions called by unity that should return the color to use for a given pixel.They are also usually run on the GPU too.

The trick here is that once the scene is rendered I take the rendered scene and pass that through a shader as a texture. By doing that I can tell Unity to change the color of a pixel of the screen for another one. Here the shader apply some kind of chromatic blur to the screen.

In Unity there are a bunch of these "screen effect". You can technically also create a new screen effect shader right in Unity. 

To apply an effect we need to create a script which has a OnRenderImage() function. Once the script is added and active, we simply need to use the Graphics.Blit() function to apply the shader to the image.

Here's the Post-processing effect page in the Unity docs

Just remember that you can't feed the shader to it: you need to make a material with  the wanted shader and pass it to the function.

Oh, and thank you! I'm really trying to make the graphics really stand out and on point!

 

Share this comment


Link to comment
12 hours ago, jb-dev said:

Sure!

So the trick is to go line by line and slowly translate from GLSL to HLSL.

It was a mater of really understanding how the shader work and cutting the unwanted parts.

If you didn't know, shaders are pieces of code that describes the way geometries are drawn. Usually there's a couple of functions called by unity that should return the color to use for a given pixel.They are also usually run on the GPU too.

The trick here is that once the scene is rendered I take the rendered scene and pass that through a shader as a texture. By doing that I can tell Unity to change the color of a pixel of the screen for another one. Here the shader apply some kind of chromatic blur to the screen.

In Unity there are a bunch of these "screen effect". You can technically also create a new screen effect shader right in Unity. 

To apply an effect we need to create a script which has a OnRenderImage() function. Once the script is added and active, we simply need to use the Graphics.Blit() function to apply the shader to the image.

Here's the Post-processing effect page in the Unity docs

Just remember that you can't feed the shader to it: you need to make a material with  the wanted shader and pass it to the function.

Oh, and thank you! I'm really trying to make the graphics really stand out and on point!

 

I did some research before doing the last comment, also thanks for answering! I did the "manual" translation to HLSL (its not like i knew what i was doing, found guide and just did it), and also found a specific tool that translates "every" shadertoy(glsl) shader to hlsl, and it didnt send any errors.

 

By both methods the material was black (not pink which is already good), and thats where i didnt know what to do, the video tutorial mentioned something about adding textures or something like that, but I couldnt find anything very specific after that.

On another source, i remember something about shaders on postprocessing? And thought that maybe those acted on the camera, i might just be wrong there.

 

Also tried the post processing stack, I also dont know if i did something wrong, but if not, it just did the game super heavy and slow, no worth for the little chromatic aberration effect it could add.
 

Ill check your info right away, thanks again.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!