LuCiFeR[SD] wrote:Nvidia provide a
CG toolkit which the other video card suppliers don't provide. it is not required for the end user... it is only a requirement for the developer (but Ogre themselves seem to have made this a requirement). you will need to install the toolkit on windows linux and OSX if you are developing on those platforms. if you are not using shaders/material scripts then no problem.
One more question about that part:
You said developers need to install the CG toolkit. I think we must redistribute it with our apps/games too.
If only required by developers, it would mean the shaders and scripts are compiled at compile time.
I think it is not the case here (and again, never read something like this before), and the stuff is compiled at runtime,
so we need to include the CG toolkit runtime.
If it would be integrated with OGRE, why do I need the CG toolkit on developer PC and not on end-user PC?
Why should it work for end-users if it already crashes on developer PC without the toolkit?
Cg (programming language) wrote:- Cg code is portable to a wide range of hardware and platforms, unlike assembly code, which usually depends on hardware and the platforms it's written for.
...
The Cg runtime library
In addition to being able to compile Cg source to assembly code, the Cg runtime also has the ability to compile shaders during execution of the supporting program. This allows the runtime to compile the shader using the latest optimizations available for hardware that the program is currently executing on. However, this technique requires that the source code for the shader be available in plain text to the compiler, allowing the user of the program to access the source-code for the shader. Some developers view this as a major drawback of this technique.
To avoid exposing the source code of the shader, and still maintain some of the hardware specific optimizations, the concept of profiles was developed. Shaders can be compiled to suit different graphics hardware platforms (according to profiles). When executing the supporting program, the best/most optimized shader is loaded according to its profile. For instance there might be a profile for a graphics card that supports complex pixel shaders, and another profile for one that supports only minimal pixel shaders. By creating a pixel shader for each of these profiles a supporting program enlarges the number of supported hardware platforms without sacrificing picture quality on powerful systems.
Does PB compile shader/materials at compile time? If not, why we need the CG toolkit on developer PCs,
and on end-user PC it is not required?
Or do we need to distribute the Cg runtime with our programs written with PureBasic/OGRE (when using CG scripts)?
Somebody able to answer this questions for sure and then add it to the PB manual as official info?
While PB does not come with this requirements, developers who want to release a game or application using PB/OGRE stuff to end-users,
need to include the dependencies. On Windows this are DirectX9 installer (AFAIK also when you use OpenGL subsystem) and maybe CG toolkit runtime.
Would be nice to make this very clear, otherwise you get only problems and complaints from your end-users - especially if your product just crashes.
We can handle it here, in a developer forum, but if you release to end-users/customers, it is a different story. Can't tell them to install all the
requirements themselves, so we need to provide a complete package with all dependencies, so it runs out-of-the-box.
Thanks in advance!