Page 1 of 1

Can't run a lot of the 3D Examples

Posted: Sat Jan 14, 2017 8:41 pm
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.

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

Posted: Sun Jan 15, 2017 10:19 am
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

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

Posted: Sun Jan 15, 2017 12:42 pm
by Fred
What's your graphic card ? Did you tried switching to 'opengl' subsystem ?

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

Posted: Mon Jan 16, 2017 12:19 am
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.

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

Posted: Mon Jan 16, 2017 9:42 am
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

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

Posted: Mon Jan 16, 2017 5:02 pm
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?

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

Posted: Tue Jan 17, 2017 8:22 am
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.

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

Posted: Tue Jan 17, 2017 9:38 am
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.

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

Posted: Tue Jan 17, 2017 1:32 pm
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.

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

Posted: Tue Jan 17, 2017 2:28 pm
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.