Browsing articles in "shaders"
Oct
1
2019

Basic Ray Marching Shader

Converted this ray marching for dummies-shader into unity. Shader Source:https://github.com/UnityCommunity/UnityLibrary/blob/master/Assets/Shaders/2D/Special/RayMarching.shader

Sep
21
2019

Modified Standard shader to start fading based on Camera Y distance

Needed this kind of effect for a small game, where:– objects below would be faded out– player can move up and down (fade should “follow”)– realtime lights should be supported basically like the old unity global fog for height, but that one doesn’t work with […]

May
25
2019

Enable HDR Color picker for Shader or Script

I needed HDR color for some old Unlit/Color-shader, and for c# script also, found out that you can add this attribute for the shader: And for the script: More info:https://docs.unity3d.com/ScriptReference/ColorUsageAttribute.htmlhttps://docs.unity3d.com/Manual/SL-Properties.html Also make sure your Camera has [x] HDR enabled

May
23
2019

Scrolling Texture Plotter using CustomRenderTexture

Saw interesting question in the forums (link) about drawing plotter like data that would scroll up, got idea about custom rendertextures (since it was similar to this effect) Basic idea: – use CustomRenderTexture, double buffered so it can read from itself – draw color32 array […]

Dec
20
2018

Marching Ants Sprite Outline Shader

Saw interesting question here https://forum.unity.com/threads/animated-outline-effects-using-shader.600028/ and unity sprite outline https://github.com/wlgys8/Sprites-Outline + stackoverflow https://stackoverflow.com/a/16856878/5452781 to the rescue! (although this is for 2D sprite..) Results: TODO – Test how this would look with screenspace values (to keep same size even if zoomed) – Maybe could check neighbor pixel […]

Nov
30
2018

Sprite Sheet Flip Book Shader

Converted this old animated sprite sheet script into shader, its useful for animating sprites from sprite sheet. (when Animator is too heavy for simple sprite animation) Could be extended to have billboard option. Shader source: *Updated: 30/11/18 to fix index wrapping and UV direction https://github.com/UnityCommunity/UnityLibrary/blob/master/Assets/Shaders/2D/Sprites/FlipBook.shader […]

Oct
19
2018

HSV Debugging and Color Match Shader

Quick test for color matching using shader, by converting colors into HSV and comparing target color with h-s-v threshold values. See Shader source at the bottom. (main image: Changing target color, shows inverted color for the texture in that matching hue position) Shader has different […]

May
26
2018

Fire Effect Using CustomRenderTexture

Converted this fire effect (by The Coding Train) into unity customrendertexture + shader. Added fire gradient color (by moving the fire calculation into alpha channel). Unity Project Sources https://github.com/unitycoder/FireEffect References CustomRenderTexture (was added to unity in 2017.1) https://docs.unity3d.com/Manual/CustomRenderTextures.html Keijiros example project (reaction-diffusion) https://github.com/keijiro/RDSystem Fire Effect […]

Jan
14
2017

[Shader] Draw World Space UI Always On Top

If you want to draw UI in VR (for example Google Cardboard), it doesn’t support ScreenSpace rendermode in canvas.. So all the UI’s are using WorldSpace RenderMode.. which causes issues when UI goes behind geometry. Fix: You can modify UI shader to disable ZTest Shader […]

Nov
28
2016

Wireframe Shader

Founded some mesh wireframe shader in the unity 5.5f2 builtin shader folder (builtin_shaders-5.5.0f2\DefaultResourcesExtra\VR\Shaders).. Changes: – Added fillcolor, outline color – Added [x] Discard option (draws only lines) – Removed stereo rendering keywords – Removed color by distance thing Download shader: https://github.com/UnityCommunity/UnityLibrary/blob/master/Assets/Shaders/2D/Effects/WireFrame.shader   Tip: You can […]

Pages:«123456»

Connect

Twitter View LinkedIn profile Youtube Youtube Join Discord Twitch

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.