Nvidia’s CG Toolkit

General discussion regarding the OpenMW project.
For technical support, please use the Support subforum.
User avatar
psi29a
Posts: 5361
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Nvidia’s CG Toolkit

Post by psi29a »

http://www.phoronix.com/scan.php?page=n ... px=MTA5NDI
http://icculus.org/mojoshader/
There's renewed efforts going into MojoShader, the project by Ryan Gordon for dealing with Direct3D HLSL shaders on non-Direct3D non-Windows platforms.
Possible replacement for CG library?
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Nvidia’s CG Toolkit

Post by scrawl »

Nope, it doesn't support high-level shaders.

Thinking about using this: http://sourceforge.net/projects/hlsl2glsl/
User avatar
psi29a
Posts: 5361
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Nvidia’s CG Toolkit

Post by psi29a »

scrawl wrote:Nope, it doesn't support high-level shaders.

Thinking about using this: http://sourceforge.net/projects/hlsl2glsl/
Is that a library you can use at runtime or is it a seperate tool to generate glsl code from hlsl offline?

Is the 'new' ogre rtshader thingy something to look at?

edit: by the way, they have moved twice and now finally live here:
https://github.com/aras-p/hlsl2glslfork
last commit is 11 days ago.

bonus:
I bumped into some issues of HLSL2GLSL's preprocessor that I am not fixing. Most issues were with token pasting operator. So I preprocess source using mojoshader's preprocessor. Grab latest from mojoshader hg, it's awesome!
hahaha...
User avatar
psi29a
Posts: 5361
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Nvidia’s CG Toolkit

Post by psi29a »

Of interesting note is this:
http://www.phoronix.com/scan.php?page=n ... px=MTEyNzU
The Open Shading Language is BSD-licensed with a C-like syntax that is modestly similar to other shading languages while tightly integrating key concepts like deferred ray-tracing, radiance closures, and BSDFs. The Open Shading Language implementation also relies upon the LLVM compiler infrastructure for translating shader networks into machine code as its JIT implementation.

Open Shading Language continues to be developed and the open-source code can be found on GitHub. This ended up being a drop of useful code by Sony. In fact, they are making much progress since opening up the code and language. Their first 100% all-OSL movie was Men In Black 3, which was released in North Americal ast month. Another Open Shanding Language movie soon reaching the theaters is The Amazing Spider-Man. Other upcoming titles using OSL include Hotel Transylvania and Oz the Great and Powerful.
https://github.com/imageworks/OpenShadingLanguage/
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Nvidia’s CG Toolkit

Post by scrawl »

This seems to be for offline rendering (CPU and not GPU)
AndreyOGL_D3D
Posts: 1
Joined: 29 Jun 2012, 08:16
Location: Russia,Moscow
Contact:

Re: Nvidia’s CG Toolkit

Post by AndreyOGL_D3D »

Hello All, nVidia Cg this is very best way to support OpenGL or Direct3D, because if would use Cg only as a compile, then a code produced by Cg may use directly by OpenGL/Direct3D without Cg runtime (CgGL.dll, CgD3D9.dll), only cg.dll. Cg RunTime is very slow, see following links:
http://forum-archive.developer.nvidia.c ... wtopic=423… p;#entry12790
http://forum-archive.developer.nvidia.c ... wtopic=459… p;#entry13741

The long time I am writing my 3D engine, he is supporting Direct3D/OpenGL. All shaders is equal for OpenGL/Direct3D. For OpenGL I am using a result are produced by Cg compiler
(using cgCreateProgram,cgGetProgramString(cgProgram,CG_COMPILED_PROGRAM)),
After I am creating GLSL shaders by a directly using OpenGL functions such as glCompileShader,glShadersource,glLinkProgram. If I am using Direct3D then are using HLSL compiler.
Post Reply