-
Notifications
You must be signed in to change notification settings - Fork 0
Shaders 1.0
There are some predefined Shaders in Fusee, ready to use in your Application. The first step you have to do is to get a shader and assign it to a variable from type ShaderProgram.
ShaderProgram _sp = MoreShaders.GetShader("Name of the Shader", RC);
A Shader contains parameters, you have to set. For example textures, colors or other values. Set the Shader in RenderContext, create parameter handels from type IShaderParam and fill it with shader parameters.
//Set the Shader
RC.SetShader(_sp);
//Get the shader parameter and assign it to the created handle
IShaderParam color = RC.GetShaderParam(_sp, "color");
Now you can set the shader values, using your handles
//Fill the shader parameter with a random color
RC.SetShaderParam(color, new float4(1,0,0,1);
Get it with:
MoreShaders.GetShader("color", RC);
Parameters, you have to set:
- float4 color;
Get it with:
MoreShaders.GetShader("texture", RC);
Parameters, you have to set:
- iTexture texture1;
Get it with:
MoreShaders.GetShader("diffuse", RC);
Parameters, you have to set:
- iTexture texture1;
Hint: Set a light to use this shader.
Get it with:
MoreShaders.GetShader("specular", RC);
Parameters, you have to set:
- iTexture texture1;
- float specularLevel;
- float shininess;
Hint: Set a light to use this shader.
Get it with:
MoreShaders.GetShader("bump", RC);
Parameters, you have to set:
- iTexture texture1;
- iTexture normalTex;
- float specularLevel;
- float shininess;
Hint: Set a light to use this shader.