Cg Error C5109
Contents |
• All times are UTC [ DST ] Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group. Color scheme by ColorizeIt!
Documents page to see all the latest whitepapers and conference presentations that can help you with your projects. Chapter 2. The Simplest Programs Chapter 2. The Simplest Programs This
Cg Fixed4
chapter introduces Cg programming through a series of simple vertex and fragment programs. The cg float4 chapter has the following four sections: "A Simple Vertex Program" presents a straightforward vertex program and explains the basic elements cg program and syntax of the Cg language. "Compiling Your Example" explains how to compile programs for different GPUs, using the concept of profiles. "A Simple Fragment Program" defines a basic fragment program and introduces fragment http://www.ogre3d.org/forums/viewtopic.php?f=2&t=35488 profiles. "Rendering with Your Vertex and Fragment Program Examples" shows how to render simple geometry with OpenGL or Direct3D. This section also mentions the concept of clipping. 2.1 A Simple Vertex Program Green is the color associated with inexperience and growth, so a Cg program for rendering a green 2D triangle is a fitting way to start learning Cg. Example 2-1 shows the complete source code for your first http://http.developer.nvidia.com/CgTutorial/cg_tutorial_chapter02.html vertex program in Cg. Source code examples in this book use boldface to indicate Cg keywords, built-in functions, and built-in data types. This notation will help you identify words in programs that have special meaning to the Cg compiler. In addition, comments in code samples are set in gray type, to distinguish them from the rest of the code. Comments in Cg work just as in C++: you can use the /* and */ delimiters, or you can precede comments with the // characters. The Naming Convention for Examples The vertex program in Example 2-1 is quite simple. The " C2E1v " prefix used in various parts of the program stands for "Chapter 2, Example 1 vertex program." We use this notation to make it easier to find examples across chapters and in the accompanying software framework. This convention makes it easier to keep track of the various examples in this book, but it is not a requirement of the Cg language itself and indeed is not a convention intended for your own programs. Example 2-1. The C2E1v_green Vertex Program struct C2E1v_Output { float4 position : POSITION; float4 color : COLOR; }; C2E1v_Output C2E1v_green(float2 position : POSITION) { C2E1v_Output OUT; OUT.position = float4(posi
top cgPlot Graphics cgPlot, x [, y] [, /ADDCMD] [, ASPECT=float] [, AXISCOLOR=string/integer] [, AXESCOLOR=string/integer] [, BACKGROUND=string/integer] [, CHARSIZE=float] [, COLOR=string/integer] [, /ERR_CLIP] [, ERR_COLOR=varies] [, ERR_THICK=integer] [, ERR_WIDTH=float] [, ERR_XHIGH=ERR_XHIGH] [, ERR_XLOW=ERR_XLOW] [, ERR_YHIGH=ERR_YHIGH] [, ERR_YLOW=ERR_YLOW] [, FONT=integer] [, /ISOTROPIC