ShaderFX for Unity Tutorials, Any?

I was looking at the Slide pdf from Kuba Cupiz, got interested in the animated shield and the outline effect and honestly everything, but there’s absolutely no detailed paper to achieve that, I would have recreated the animated shield effect but to my misfortune I don’t know how to duplicate the extruded vertices along the normals instead of just repositioning them, and how to assign to the copied vertices a seperate animated shader after that.
Guys it’s really frustrating to see that there is no deep detailed book or something that enable us to go pro on the shader side.
Please no more shaders in the repository, just show us how we do them, I did some dissolve shaders and such but I would never achieve it without dissecting a primal version of, the same dissection allowed me to spot the global variable _Time that I would’ve never know existant otherwise from the docs.
Please document the shader section with some basic techniques, it’s too much of a journey to become a shader programmer.

For the benefit of future readers, samiyubedas is referring to Kuba and Ole’s slides from their SIGGRAPH 2011 presentation.

Graphics programming is a large and often difficult subject, but there are plenty of resources available for learning about it. I recommend getting Real-Time Rendering, which is a solid introduction to the field, and an excellent reference to have handy.

As any graphics programmer will tell you, though, the difficult part of writing shaders is never the concept or code, but how to get it to work with your engine of choice. Learning to do this takes time, and learning by example and experimentation is usually the best way.

Shaderlab’s documentation is improving steadily, and it’s worth re-reading as you get more experienced. You never know what you missed on the first read-through. _Time is documented in the built-in values section, along with a number of other useful variables.

Thanks Daniel, I’ll make sure to take a look at it, it’s just that I’m not sure how to map the techniques from such books to Unity, it should be almost identical but since surface shaders don’t aloow for deep low level access I doubt I’ll be able to port the shaders and knowledge to Unity
What will happen if I run into an assembly shader for example.
Thanks for respond and for the built-in values section, i didn’t see it in docs bundled with unity.

If you run into an assembly shader, then the author probably doesn’t want you using it. Stick with examples written in Cg/HLSL, or GLSL if you’re familiar with that.

Your original problem of not being able to duplicate the vertices in a shader is just a limitation of vertex shaders. Only geometry shaders (not yet supported by Unity) can change the number of vertices on the GPU. The easiest approach is probably just to add a second material to your Renderer’s Material list. This will tell Unity to render the object twice, so your shield rendering shader can be completely separate from the object’s normal appearance.

Surface shaders are designed to hide the complexity of Unity’s lighting model while exposing surface properties for easy specification. If you want to do anything without lighting, you should write your own vertex/fragment combinations. Here is a very basic single-texture shader that could serve as a starting point for any number of things:

Shader "Custom/Basic Unlit" {
	Properties {
		_MainTex ("Base (RGB)", 2D) = "white" {}
	}
	SubShader {
		Tags { "RenderType"="Opaque" }
		LOD 200
		
		Pass {
			CGPROGRAM
				#pragma vertex vert
				#pragma fragment frag
				#include "UnityCG.cginc"
				
				struct v2f {
					float4 pos : SV_POSITION;
					float2 uv_MainTex : TEXCOORD0;
				};
				
				float4 _MainTex_ST;
				
				v2f vert(appdata_base v) {
					v2f o;
					o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
					o.uv_MainTex = TRANSFORM_TEX(v.texcoord, _MainTex);
					return o;
				}
				
				sampler2D _MainTex;
				
				float4 frag(v2f IN) : COLOR {
					half4 c = tex2D (_MainTex, IN.uv_MainTex);
					return c;
				}
			ENDCG
		}
	}
}

I like the approach of this book quite a lot: Shaders for Game Programmers and Artists: 9781592000920: Computer Science Books @ Amazon.com It gives a good introduction into HLSL/CG and then explains all the basic techniques from basic color manipulation over normalmapping to animating the vertices. And if you are good with that stuff you should be ready to dig into the ShaderX, GPU Pro and GPU Gems books and all the papers on the net. Those books usually come with detailed easy to follow explanations and example codes. The limit with all those papers usually are however the math skills of the reader :P.

Oh, how didn’t I think about a second material? what an idiot.
Thanks, I got it from here. at least now all I’m concerned about are screen effects.