// Material Box
vertex_program PlainTexture_VS cg
{
source GameObjStandard.cg
entry_point main_plain_texture_vp
profiles vs_1_1
default_params
{
param_name_auto worldViewProj worldViewproj_matrix
}
}
fragment_program PlainTexture_PS cg
{
source GameObjStandard.cg
entry_point_ main_plain_texture_fp
profiles ps_1_1
}
material Caja/Madera
{
technique
{
pass
{
vertex_program_ref PlainTexture_VS
{
}
fragment_program_ref PlainTexture_PS
{
}
texture_unit
{
texture Caja.jpg
}
}
}
}
// File CG
void main_plain_texture_vp(
// Vertex Inputs
float4 position : POSITION, // Vertex position in model space
float2 texCoord0 : TEXCOORD0, // Texture UV set 0
// Outputs
out float4 oPosition : POSITION, // Transformed vertex position
out float2 uv0 : TEXCOORD0, // UV0
// Model Level Inputs
uniform float4x4 worldViewProj)
{
// Calculate output position
oPosition = mul(worldViewProj, position);
// Simply copy the input vertex UV to the output
uv0 = texCoord0;
}
void main_plain_texture_fp(
// Pixel Inputs
float2 uv0 : TEXCOORD0, // UV interpolated for current pixel
// Outputs
out float4 color : COLOR, // Output color we want to write
// Model Level Inputs
uniform sampler2D texture) // Texture we're going to use
{
// Just sample texture using supplied UV
color = tex2D(texture, uv0);
}
I'm trying to learn, I am following the official documentation of Ogre
http://www.ogre3d.org/tikiwiki/tiki-ind ... +Materials