Browsing articles tagged with " shader"
Aug
9
2016

Shader Z-Fight Offset

(screenshot with Quad mesh placed on top of Plane with raycast hit.point) If you want to use Raycast hit.point to place quad on a flat surface, it will most likely create Z fighting issue.. You could add position offset by hit.point+Vector3(0,0.1f,0), Or use modified shader […]

Aug
4
2016

Shader error: cannot map expression to vertex shader instruction

Had a strange looking error today: Turns out it was just that the function which was called inside vertex shader, was below the vertex shader, so just moved it above the v2f vert (appdata v) and it works.. *Actually it was more complicated: This one […]

Jul
23
2016

Using RenderDoc with Unity (graphics debugger)

“RenderDoc is a stand-alone graphics debugging tool” Getting Started – Download standalone https://renderdoc.org/builds – Install it – Start Unity 5.3 or later (I tested with 5.4beta.f2) – Right click over the Game- or Scenewindow title, RenderDoc option should be displayed in the menu, Select it […]

Jul
3
2016

Fake Tube Light Shader

Tried to test idea about tube lights (or “line light”), by using custom lighting in shader, you could sample the light several times from different positions/angles, so that it looks like the light is not just a single point. (not really working here properly yet, […]

Jun
26
2016

Unlit Fake Curved World Shader

Tried to get world position from depth texture, but it didn’t work.. then founded COMPUTE_DEPTH_01 instead, makes nice curve effect when applied to meshes (pushing the y vertices down based on depth).. although breaks a bit depending on camera rotation/position.. Shader source: https://github.com/UnityCommunity/UnityLibrary/blob/master/Shaders/Vertex/UnlitFakeCurved.shader without curve-shader: […]

Mar
23
2016

Volumetric Image Effect Shader

  Converted this old godrays shader ( http://unitycoder.com/blog/2012/10/02/fake-godrays-shader/ ) into image effect – interesting results! (see video below)     Source codes below (Attach script to main camera) This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. […]

Dec
21
2015

Matrix Playground Shader

Finally decided to try shader matrices.. (because having issues with custom billboard shader) Doing Translate, Scale, Rotations with matrix operations seems quite simple actually! Would had been totally lost without these two links: http://www.codinglabs.net/article_world_view_projection_matrix.aspx http://www.gamedev.net/topic/610115-solved-rotation-deforming-mesh-opengl-es-20/#entry4859756 How to use the shader: – Get the source below, […]

Dec
6
2015

Custom shader Transparency & Batching issues

While updating this billboard shader https://github.com/unitycoder/DoomStyleBillboardTest , had couple strange shader issues: Problem#1: Overlapping transparent area clips other object behind it (see issue#6) This one was solved by adding “ZWrite Off” to the shader, apparently something to do how transparent objects get depth sorted..(?) http://docs.unity3d.com/Manual/SL-CullAndDepth.html […]

Nov
25
2015

Opaque Sprite Shader

(screenshot of modified shader properties in debug view mode) Modified built-in sprite shader so that its opaque, no color tint, and pixel snap is always on. Just to test if there are any performance benefits to use them for opaque sprite tiles, at least the […]

Apr
6
2015

Doom Style Billboard Shader

Testing Doom style billboard shader, where you can look sprite from different angles, still not completely finished but enough for testing.. * Note: I have no idea how the doom billboards work, just looking for similar style Related forum post: http://forum.unity3d.com/threads/relative-position-for-changing-2d-graphics-in-3d-environment.307086/ WebGL player: *coming later* […]

Connect

Twitter View LinkedIn profile Youtube Github Join Discord Twitch Instagram BlueSky

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.