Page 2 of 3

Re: Klein Bottle example

Posted: Sun Mar 17, 2013 12:07 am
by Danilo
LuCiFeR[SD] wrote:and an installer check for the NV CG toolkit too wouldn't go amiss.
Do I need this with AMD graphics card? And the guys with Intel graphics?

Does PureBasic require NVIDIA graphics card for full features, or what is the dependency here?
Really confusing, PB/OGRE requirements, dependencies, tools. Would be much better to have it
all in one (addon-)package, including some tools required for using PB 3D Engine (model converter, World editor, ...).

Sorry for off-topic.

Re: Klein Bottle example

Posted: Sun Mar 17, 2013 3:57 am
by idle
Danilo wrote:
LuCiFeR[SD] wrote:and an installer check for the NV CG toolkit too wouldn't go amiss.
Do I need this with AMD graphics card? And the guys with Intel graphics?

Does PureBasic require NVIDIA graphics card for full features, or what is the dependency here?
Really confusing, PB/OGRE requirements, dependencies, tools. Would be much better to have it
all in one (addon-)package, including some tools required for using PB 3D Engine (model converter, World editor, ...).

Sorry for off-topic.
Yes, you do need the nvidia cg took kit if you want to compile examples with materials that have cg scripts in them

No, PB doesn't need an Nvidia card for full features

perhaps for windows it would be a good idea.

Re: Klein Bottle example

Posted: Sun Mar 17, 2013 4:39 am
by applePi
Yes, you do need the nvidia cg took kit if you want to compile examples with materials that have cg scripts in them
thank you idle for explaining this, i have used PB 3D for years and never needed or heard about NV CG toolkit , it is only when Comtois posted his Compositor example for leisure and entertainment a few days ago that needs Cg, i consider it is a feature that Ogre can use and call other Libraries for very special demonstrations.

Re: Klein Bottle example

Posted: Sun Mar 17, 2013 2:33 pm
by LuCiFeR[SD]
Nvidia provide a CG toolkit which the other video card suppliers don't provide. It will be required on the developer and end users systems (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.

Through a lot of experimentation with my intel graphics based laptop, and Purebasic/ogre I found that under windows, the NV CG toolkit being installed stoped PB crashing with certain 3D examples. But, imy laptop fails to load .dds files properly. I found that if I converted them to png, no problem. loaded without error in windows and linux.

but PB (apart from in the history in the docs) makes no real mention of its requirement... and to be honest, this will just end up as an infinite loop of postings of "Why does PB crash when I try to run xxx3D.pb" or why do I get a black screen when I use the terrain examples.

I can only really share my findings, but they are not the definitive answer to life the universe and everything :)

Re: Klein Bottle example

Posted: Sun Mar 17, 2013 6:18 pm
by Fred
From the InitEngine3D() doc: http://www.purebasic.com/documentation/ ... ine3d.html

Code: Select all

#PB_Engine3D_EnableCG   : Enable CG library support. It needs to be installed before use from nvidia website.

Re: Klein Bottle example

Posted: Sun Mar 17, 2013 8:01 pm
by LuCiFeR[SD]
Fred wrote:From the InitEngine3D() doc: http://www.purebasic.com/documentation/ ... ine3d.html

Code: Select all

#PB_Engine3D_EnableCG   : Enable CG library support. It needs to be installed before use from nvidia website.
which is not exactly obvious if you are just running an example Fred.

and with that I walk away and shut up before I really say something I will regret.

Re: Klein Bottle example

Posted: Sun Mar 17, 2013 8:18 pm
by Danilo
LuCiFeR[SD] wrote:
Fred wrote:From the InitEngine3D() doc: http://www.purebasic.com/documentation/ ... ine3d.html

Code: Select all

#PB_Engine3D_EnableCG   : Enable CG library support. It needs to be installed before use from nvidia website.
which is not exactly obvious if you are just running an example Fred.
Yep, that's true. I checked 3D Engine overview for the OGRE requirements, but I should have
read help for all commands again.

Re: Klein Bottle example

Posted: Mon Mar 18, 2013 6:59 am
by Danilo
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!

Re: Klein Bottle example

Posted: Mon Mar 18, 2013 2:19 pm
by LuCiFeR[SD]
Danilo wrote: 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?
Actually Danilo, maybe I am mistaken in my assumption and you are correct.... but either way it is not clear. On the Ogre site you have a list of dependencies but it says the CG stuff is optional. but it is not clear about whether the nv cg toolkit is required on the end users machine.

I guess Fred would know more... its not like I am in any way shape or for part of Fantaisie software, and anything I say is purely down to my own experimentation, and to quote myself from above
LuCiFeR[SD] wrote:I can only really share my findings, but they are not the definitive answer to life the universe and everything
but this certainly needs to be investigated further... and like a bloodhound, I shall do so :)

Re: Klein Bottle example

Posted: Mon Mar 18, 2013 3:02 pm
by LuCiFeR[SD]
Danilo, you were correct. it will be required on the end users machine too.

Re: Klein Bottle example

Posted: Mon Mar 18, 2013 8:07 pm
by Danilo
LuCiFeR[SD] wrote:Danilo, you were correct. it will be required on the end users machine too.
Thanks LuCiFeR[SD]! Now it would be nice to know exactly what version of CG toolkit runtime is required for redistributing.

Is latest version always good (means 100% compatible), or do we need to include version 1.4.x or 2.0.x runtime (supported OGRE dependency)?

Current version is CG Toolkit 3.1.0013 (April 2012). Older versions are available at CG Toolkit archive.
Cg Redistributable Binaries

The redistributable binaries of Cg libraries and executables are found within the respective Cg Toolkit package.
Should also be added to the "Requirements" page in the PB manual. Maybe a table with version numbers.

Code: Select all

PureBasic version   |   CG Toolkit version
     5.11                      2.0.x
     6.00                      3.1.x
     7.00                      5.3.x
Hope someone will enlighten us. ;)

Re: Klein Bottle example

Posted: Tue Mar 19, 2013 12:59 am
by Fred
You can use the lastest version, it should stay ABI compatiable

Re: Klein Bottle example

Posted: Tue Mar 19, 2013 7:26 am
by Danilo
Fred wrote:You can use the lastest version, it should stay ABI compatiable
Thanks!

Re: Klein Bottle example

Posted: Wed Mar 20, 2013 1:52 pm
by MachineCode
I just installed 5.11 and I now get this error message instead of a crash:

Code: Select all

Line: 29 - InitEngine3D() must be called successfully before using the 3D commands set.
Better than outright crashing. Also to Fred: I do have DirectX 11 installed, but the example still doesn't run.

Re: Klein Bottle example

Posted: Wed Mar 20, 2013 3:19 pm
by applePi
MachineCode, in the past i have faced your "d3dx9_42.dll" situation every time i reinstall the windows and trying to run games and programs which needs dx9c. look at the requirements in the PB help file which are packaged with PB from version 5.10: there is a link to a web install of dx9c. else look at the recent post (Jan 05, 2012) here http://www.purebasic.fr/english/viewtop ... dx9_42.dll about D3DX9_42.DLL , download the directx_Jun2010_redist.exe from http://www.microsoft.com/en-us/download ... en&id=8109 , i have this file for emergencies, install it. if the error d3dx9_42.dll persist then extract it with winrar like this:
1- open winrar and drag the directx_Jun2010_redist.exe into its title bar then extract all its *.cab files
2- look at the Aug2009_d3dx9_42_x86.cab file (or Aug2009_d3dx9_42_x64.cab _depends on your system) and extract its contents with winrar. it contains the file "d3dx9_42.dll" Hallelujah ,copy all the 5 files to windows/system32 in windows xp, in windows 7 i don't know.
you may also read this article ""d3dx9_42.dll is missing from your computer" - can't run game because" http://answers.microsoft.com/en-us/wind ... bfec479e9e

PS: i remember it is not enough to install the latest dx if the game or program needs the dx9c, so you need to install dx as above you can install dx11 after that again and again and the d3dx9_42.dll will stay there