Shaders [Don't understand !]

Hi all, i try to make shader but i don’t understand :s
For example, i take the refraction shader from nvidia:

This is the vertex shader

struct inputs
float4 Position : POSITION;
float4 Normal : NORMAL;
struct outputs
float4 hPosition : POSITION;
float4 fresnelTerm : COLOR0;
float4 refractVec : TEXCOORD0;
float4 reflectVec : TEXCOORD1;
// fresnel approximation
fixed fast_fresnel(float3 I, float3 N,
float3 fresnelValues)
fixed power = fresnelValues.x;
fixed scale = fresnelValues.y;
fixed bias = fresnelValues.z;
return bias + pow(1.0 - dot(I, N), power) * scale;
outputs main(inputs IN,
uniform float4x4 ModelViewProj,
uniform float4x4 ModelView,
uniform float4x4 ModelViewIT,
uniform float theta)
outputs OUT;
OUT.hPosition = mul(ModelViewProj, IN.Position);
// convert the position and normal into
// appropriate spaces
float3 eyeToVert = mul(ModelView, IN.Position).xyz;
eyeToVert = normalize(eyeToVert);
float3 normal = mul(ModelViewIT, IN.Normal).xyz;
normal = normalize(normal);

and the Pixel Shader:

float4 main(in float3 refractVec : TEXCOORD0,
in float3 reflectVec : TEXCOORD1,
in float3 fresnelTerm : COLOR0,
uniform samplerCUBE environmentMaps[2],
uniform float enableRefraction,
uniform float enableFresnel) : COLOR
float3 refractColor = texCUBE(environmentMaps[0],
float3 reflectColor = texCUBE(environmentMaps[1],
float3 reflectRefract = lerp(refractColor, reflectColor,
float3 finalColor = enableRefraction ?
(enableFresnel ? reflectRefract : refractColor) :
(enableFresnel ? reflectColor : fresnelTerm);
return float4(finalColor, 1.0);

How to transform it in shader which can run on panda3d?
If there is an other exemple easier for understand…
thx :smiley:

Make sure you’ve read all shader stuff in the manual.
For examples, you can look at the CodeSnippet forum section.