Why'd you need a shader for that (tree shader, ed)? GPU shaders should be a little more generic imho. Trees made such a way (two polygon cross) should just be exported from 3ds max with normals pointing up (my exporter plugin can do that). Why not just write a little tool that takes a bunch of dofs and changes the normals to point up?
The Official Shaders-Language for OpenGL is GLSL and not Cg.Cg or C for Graphics is a high-level shading language developed by Nvidia in close collaboration with Microsoft for programming vertex and pixel shaders. It is very similar to Microsoft's HLSL.
Cg is based on the C programming language and although they share the same syntax, some features of C were modified and new data types were added to make Cg more suitable for programming graphics processing units.
This language is only suitable for GPU programming and it does not replace a general programming language.
The Cg compiler outputs DirectX or OpenGL shader programs.
OpenGL ARB:GLSL (OpenGL Shading Language), also known as GLslang, is a high level shading language based on the C programming language. It was created by the OpenGL ARB to give developers more direct control of the graphics pipeline without having to use assembly language or hardware-specific languages. Current specification for GLSL is version 4.00.
I am programming with OpenGL for years now and never used Cg-shaders.The OpenGL Architecture Review Board (ARB) is an industry consortium that governed the OpenGL specification. It was formed in 1992, and defined the conformance tests, approved the OpenGL specification and advanced the standard. On July 31, 2006, it was announced that the ARB voted to transfer control of the OpenGL specification to Khronos Group.
Voting members included 3Dlabs, Apple, ATI, Dell, IBM, Intel, NVIDIA, SGI and Sun Microsystems, plus other contributing members. Microsoft was an original voting member, but left in March 2003
GLSL as a standard high level shading language in OpenGL , Cg as a transitional or vendor specific high level shading language, I have no comment which one is better. However, GLSL should be a trend for the industry and acadermic in the coming years.
Our 3D guys tried to export trees with normals pointing up, but the ASE export seemed to enforce recalculation of normals based on the smoothing groups etc, so that failed. Trees are also something that need to be looked at; they need normal maps (generated by SpeedTreeCAD?) and light-direction dependent lighting really.
From Wikipedia:
The Official Shaders-Language for OpenGL is GLSL and not Cg.
from Wikipedia:
OpenGL ARB:
I am programming with OpenGL for years now and never used Cg-shaders.
GLSL is the standard programing language for OpenGL-only Applications.
Another reason is that i dont need any kind of dll's(like cg.dll etc.)
As you see the Cg-language is developed by nvidia and microsoft to unify the shader language to use with DX and OpenGL without changes.
from Orange Book:
Hehe, it looks complicated.
So we should ideally be writing in GLSL?