Can't run a lot of the 3D Examples

Everything related to 3D programming
coco2
Enthusiast
Enthusiast
Posts: 368
Joined: Mon Nov 25, 2013 5:38 am
Location: Australia

Can't run a lot of the 3D Examples

Post by coco2 »

Has anyone else noticed this (eg examples/3d/vehicle.pb)? When trying to run them it crashes Purebasic1_Compilation1.exe has stopped working. Tried Windows 10, Windows 7, 32 and 64 bit PB 5.51. Also tried 5.44 64 bit and it couldn't even compile them. Tried turning off Windows Defender.
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: Can't run a lot of the 3D Examples

Post by applePi »

vehicle and vehicleTerrain works okay with me(PB 5.51 winxp32 Graphics card nvidia geforce GT 640)
you may need to install directX 9,0c, look this thread http://purebasic.fr/english/viewtopic.p ... po#p484189
download the 95MB file and install it, it is found also in http://download.microsoft.com/download/ ... redist.exe

and try again. even if you have dx 11 you need to install dx 9
look Documentation here https://www.purebasic.com/documentation ... ine3d.html
also try setting the compiler options to opengl , and then try the examples
Fred
Administrator
Administrator
Posts: 16619
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Can't run a lot of the 3D Examples

Post by Fred »

What's your graphic card ? Did you tried switching to 'opengl' subsystem ?
coco2
Enthusiast
Enthusiast
Posts: 368
Joined: Mon Nov 25, 2013 5:38 am
Location: Australia

Re: Can't run a lot of the 3D Examples

Post by coco2 »

It's NVidia GeForce GTX 970. It also did it on my Windows 7 laptop which had an Intel graphics card (which I no longer have I replaced it yesterday with a Windows 10 laptop). Common to both machines was that I had reinstalled them recently. It works with openGL! Thanks for showing me that Fred. It looks as though I don't have DirectX 9 installed. I wish there was a way to detect that within the application so I could show an error. EDIT: it works when I installed DX9. EDIT2: but now I can't set it to use OpenGL, it gives an error trying to initialise the 3D engine. Anyone know why? Also, if anyone knows how to detect DX9 is installed that would be good to know.
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: Can't run a lot of the 3D Examples

Post by applePi »

but now I can't set it to use OpenGL
just a suggestion, re install the graphics card drivers again, since it will reinstall the opengl drivers
how to detect DX9 is installed
running dxdiag.exe as told by: http://www.wintips.org/how-to-check-and ... ur-system/
in my windows 7/32 told me i have directx version 11, but does not say anything about dx9 even it is installed previously
but searching the windows 7 folder i have found 20 d3dx9*.dll files, the same in windows XP.
Image
coco2
Enthusiast
Enthusiast
Posts: 368
Joined: Mon Nov 25, 2013 5:38 am
Location: Australia

Re: Can't run a lot of the 3D Examples

Post by coco2 »

It is working now I'm not sure why. It might be an update in Windows 10, I know it fixed an issue with the display, so it might have fixed my OpenGL issue. I'm wondering if it's better for me to develop using OpenGL. Is there a problem compiling with OpenGL on Windows? Is it much slower?
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: Can't run a lot of the 3D Examples

Post by applePi »

Is there a problem compiling with OpenGL on Windows?
i noticed only 2 cases, there may other cases:
1- with dx9 the color seems better, look example :Examples\3D\Demos\MeshManualFlag.pb
with the default compiler option (ie dx9) the flag color is like its texture color:
Image

but with Opengl option, it is different:
Image
and may be different with different grahics cards
EDIT:
it seems this color difference only in this example, the other examples seems okay

2- SetMeshData does not work with OpenGL compiler option, look example Examples\3D\SetMeshData.pb run it with opengl option and the flag will not animate. there is a bug report about that.
regarding the difference in speed, only who develop games can answer about this.
Last edited by applePi on Tue Jan 17, 2017 1:23 pm, edited 1 time in total.
DarkDragon
Addict
Addict
Posts: 2218
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: Can't run a lot of the 3D Examples

Post by DarkDragon »

The color shouldn't be that different. I suspect some bug in the OpenGL subsystem if you experience this, because why should there be that much yellow? The fact that different graphics cards have different results is also a problem with DirectX, not only with OpenGL.
bye,
Daniel
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: Can't run a lot of the 3D Examples

Post by applePi »

@DarkDragon, it seems this big color difference is only in this example, while in other examples it is okay. don't know the reason , when we change the normal like MeshVertexNormal(1,1,1) it will be more real. it is possible also related to the color.
i have tested the example in windows xp, and windows 7 in the same desktop machine. also tested it on another older computer with ATI radeon hd 5450 card, the same results.
DarkDragon
Addict
Addict
Posts: 2218
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: Can't run a lot of the 3D Examples

Post by DarkDragon »

If it is dependent on the normal I assume that in DirectX subsystem normals are being normalized while in OpenGL they are not or vice versa.
bye,
Daniel
Post Reply