Cg is a high-level shading language developed by Nvidia.
Questions tagged [cg]
300 questions
2
votes
1 answer
Pre-Pass Lighting OpenGL implementation artifact
I am implementing Pre-Pass Lighting algorithm in OpenGL for my master dissertation project, after implementing a Deferred renderer as well. The Deferred renderer works perfectly and I based the implementation of PPL on it. I got a very weird…

Matteo Meli
- 33
- 4
2
votes
1 answer
Linking Nvidia's Cg framework statically in Xcode
10 billion kudos for life to anyone who can figure this one out.
Nvidia only provides a standard framework for Cg, which I cannot figure how I can link statically. I need to link it statically because it's for a plugin.
Is there any way at all this…

toastie
- 1,934
- 3
- 22
- 35
2
votes
3 answers
Cg Framework not being recognized by XCode 3.2.6
I have Cg installed to /Library/Frameworks/Cg.framework. It looks like this on disk:
My XCode 3.2.6 project has Library/Frameworks as a Framework Search Path and -Framework Cg in "Other Linker Settings" but when I try to #include it can't…

Mr. Boy
- 60,845
- 93
- 320
- 589
2
votes
1 answer
Volume rendering using Cg:compile error:semantic "POSITION" not visible in this profile
I am now coding to implement direct ray-casting volume rendering using OpenGL,Cg and C++.My computer's system is Win7 and my graphics is nVidia GTX570.
Actually,I have implement basic functions of direct ray-casting volume rendering sucessfully.But…

XiaJun
- 1,855
- 4
- 24
- 41
1
vote
1 answer
Motion Blur direction identification DirectX
I am storing velocity information in the texture. As texture can only have color values in range {0, 1} How should I determine the direction of the velocity ?
One solution is to create another texture which stores only the direction information for…

algonite
- 13
- 3
1
vote
2 answers
Simple GPU programming (with Cg?)
I am eager to find out how to use the parallel processing power of GPUs. However, I am NOT eager to make graphics! I tried the tutorial of Cg, but it seems heavy with graphics terms. Furthermore, I can't seem to grasp how I can connect such a…

user1058795
- 239
- 1
- 2
- 11
1
vote
1 answer
Stacking Cg shaders
In my engine I load Cg shaders from pairs of vertex/pixel shader files. I would like to be able to stack shaders to combine them (lighting + material, etc.). Short of breaking up the shaders into separate functions and then creating a single shader…

toastie
- 1,934
- 3
- 22
- 35
1
vote
1 answer
Can a shader sample a block/region of pixels in a texture?
Are there ways a shader can query the sum/average of a block of pixels in a texture read, rather than looking up a single value? I'm working in Cg but any examples and search terms are welcome.
I specifically mean built-in ways, NOT looping manually…

Mr. Boy
- 60,845
- 93
- 320
- 589
1
vote
1 answer
(How) can a shader view the current render-buffer?
Is it possible for a pixel shader to see the current state of the depth/color/stencil buffer?

Mr. Boy
- 60,845
- 93
- 320
- 589
1
vote
1 answer
Is nVidia's Cg dead?
I like Cg but it seems to be a long way behind GLSL/HLSL now - only supporting fragment & vertex shaders, for instance.
Is it still being developed or has it been given up - in which case is there no longer a way to write GPU-independent shaders?

Mr. Boy
- 60,845
- 93
- 320
- 589
1
vote
0 answers
Closing Bezier Path
I am adding many small pieces of lines and curves to a UIBezierPath. But it is impossible to determine which element is added next. In the end the Path is a closed path with no interrupts.
Now I wanna animate an object on the BezierPath. It works,…

Robert Weindl
- 1,092
- 1
- 10
- 30
1
vote
1 answer
How to get an uniform location of a Cg shader with OpenGL?
I've dabbled with basic shader programming before, using the GLSL way. Now I've come back to it, using Cg shaders. Following the tutorial at Josh Beam's website I've achieved the desired functionality, was able to change my shader around, however I…

zyndor
- 1,418
- 3
- 20
- 36
1
vote
1 answer
How far can you push Cg?
I have been told by experienced shader developers that while Cg is great for simple shaders, it is advised to do GLSL/HLSL directly for advanced shaders, due to bugs in resultant shader code.
What specifically are the limits and/or known problems…

Mr. Boy
- 60,845
- 93
- 320
- 589
1
vote
2 answers
How to create a CgFx like effect system?
Seriouse graphics engine like CryEngine3, Unreal Engine 3 have their customized shader language and effect system. While trying to find some effect system for my small graphics framework, it looks like nvidia CgFx is the only choice (seems Khronos…

Raymond
- 66
- 9
1
vote
0 answers
3D volume rendering : fence-like artifact
I need to perform 3D volume rendering on 3D medical ultrasound image dataset, and found a sample code from Nvidia GPU-gem (https://developer.nvidia.com/gpugems/gpugems/part-vi-beyond-triangles/chapter-40-applying-real-time-shading-3d-ultrasound)
The…

Nate
- 59
- 1
- 5