Orange Shader
Your first and easiest shader
Welcome to the new Ogre Wiki!
If you haven't done so already, be sure to visit the Wiki Portal to read about how the wiki works. Especially the Ogre Wiki Overview page.
If you haven't done so already, be sure to visit the Wiki Portal to read about how the wiki works. Especially the Ogre Wiki Overview page.
Table of contents
Description
This is the first and easiest shader. It is not very useful, except for a tutorial purpose. It will just paint your object in a predefined color (here: orange).
Usage
Just give the material shader/orange to your object.
orangeshader.cg
// ----------------------------------------------------------- // Very simple shader // The object is colored in orange // ----------------------------------------------------------- float4 main_fp(in float3 TexelPos : TEXCOORD0) : COLOR { float4 oColor; oColor.r = 1.0; oColor.g = 0.8; oColor.b = 0.0; oColor.a = 0.0; return oColor; }
orangeshader.material
Note: See http://www.ogre3d.org/docs/manual/manual_18.html for a list of profiles
fragment_program shader/orangeFP cg { source orangeshader.cg entry_point main_fp profiles ps_1_1 arbfp1 } material shader/orange { technique { pass { fragment_program_ref shader/orangeFP { } texture_unit { } } } }
Alias: Orange_Shader
Contributors to this page: jacmoe
and
Ramy
.
Page last modified on Monday 28 of June, 2010 18:06:03 GMT by jacmoe
.
The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.
As an exception, any source code contributed within the content is released into the Public Domain.
Sidebar
Search box
Online users
44
online users

