OGRE Wiki
Support and community documentation for Ogre3D
Ogre Forums
ogre3d.org
Log in
Username:
Password:
CapsLock is on.
Remember me (for 1 year)
Log in
Home
Tutorials
Tutorials Home
Basic Tutorials
Intermediate Tutorials
Mad Marx Tutorials
In Depth Tutorials
Older Tutorials
External Tutorials
Cookbook
Cookbook Home
CodeBank
Snippets
Experiences
Ogre Articles
Libraries
Libraries Home
Alternative Languages
Assembling A Toolset
Development Tools
OGRE Libraries
List of Libraries
Tools
Tools Home
DCC Tools
DCC Tutorials
DCC Articles
DCC Resources
Assembling a production pipeline
Development
Development Home
Roadmap
Building Ogre
Installing the Ogre SDK
Setting Up An Application
Ogre Wiki Tutorial Framework
Frequently Asked Questions
Google Summer Of Code
Help Requested
Ogre Core Articles
Community
Community Home
Projects Using Ogre
Recommended Reading
Contractors
Wiki
Immediate Wiki Tasklist
Wiki Ideas
Wiki Guidelines
Article Writing Guidelines
Wiki Styles
Wiki Page Tracker
Ogre Wiki Help
Ogre Wiki Help Overview
Help - Basic Syntax
Help - Images
Help - Pages and Structures
Help - Wiki Plugins
Toolbox
Freetags
Categories
List Pages
Structures
Trackers
Statistics
Rankings
List Galleries
Ogre Lexicon
Comments
History: How To Compile CG Files
View page
Source of version: 6
(current)
If you are a beginner trying to get into .cg you will quickly learn that it is pretty finicky; Much more picky than fixed function. If you are running around in the dark trying to figure out what the hell is wrong with your .cg code, following these instructions will put an end to all that. {maketoc} !!Step 1 - Install the compiler from Nvidia Install the appropriate [http://developer.nvidia.com/object/cg_toolkit.html|CG Toolkit from NVidia] (download is near the bottom of the page) !!Step 2 - Using the CG Compiler (cgc.exe) When you first go through the installed files you find a file called __cgc.exe__ inside the directory: __C:\Program Files\NVIDIA Corporation\Cg\bin__ Open your command shell (in Windows you can do it by typing 'cmd' inside Run...) You can then use the following command lines to point it to whatever .cg files you want: {MONO()}cgc -entry yourMainFP -profile ps_2_0 yourFile.cg{MONO} or {MONO()}cgc -entry yourMainVP -profile vs_1_1 yourFile.cg{MONO} !!Step 3 - Set local working directory Next, you will probably find that either cgc.exe or your .cg file can't be located. That's because you need to set your current working directory. I recommend setting the current directory to the location of your .cg file. If you are new to this you do it with the '__cd'__ command: {MONO()}cd "C:\Path\to\my\cg\file"{MONO} After that, now we are ready to run real commandlines, here is my final commandline: {MONO()}"C:\Program Files\NVIDIA Corporation\Cg\bin\cgc.exe" -entry myVPentryPoint -profile vs_1_1 myFile.cg{MONO} If you would like to see the assembler generated when the cg is compiled use the '-l' command. Here's an example: {MONO()}cgc -entry yourMainVP -profile vs_1_1 yourFile.cg -l assembler_output.txt{MONO} --- Alias: (alias(How_To_Compile_CG_Files))
Search by Tags
Search Wiki by Freetags
Latest Changes
IDE Eclipse
FMOD SoundManager
HDRlib
Building Ogre V2 with CMake
Ogre 2.1 FAQ
Minimal Ogre Collision
Artifex Terra
OpenMB
Advanced Mogre Framework
MogreSocks
...more
Search
Find
Advanced
Search Help
Online Users
148 online users