Page 1 of 2

yes, next step, next problem, WorldShadows()

Posted: Mon Jul 15, 2019 6:01 pm
by marc_256
Yes, next problem

Without using WorldShadows(), the program works fine.
When I use this ...

Code: Select all

WorldShadows(#PB_Shadow_Additive, 10000, $202020)
or
WorldShadows(#PB_Shadow_Modulative, -1, RGB(255, 0, 0))
The program quits, without any error message ?

I use WIN 10 - PB5.71B1x64


marc

Re: yes, next step, next problem, WorldShadows()

Posted: Mon Jul 15, 2019 8:32 pm
by Samuel
Do the world shadows work in any of purebasic's example shadow programs? Have you tried opengl and directx?
Do you have a very high poly entity in your example? That could be causing the internal 16 bit vertex/index buffers to be out of bounds when stencil shadows are enabled.

Re: yes, next step, next problem, WorldShadows()

Posted: Tue Jul 16, 2019 1:35 pm
by marc_256
hi Samuel,

When I test the PB examples, they works very well ...
And with my robot meshes noting is working.

And yes, all my meshes of the robot are very high poly entity's ...
So, thank you, now I know why PB is not working at all.

Is this a OGRE problem or a PB problem ?
And can this be updated ?

marc

Re: yes, next step, next problem, WorldShadows()

Posted: Tue Jul 16, 2019 2:28 pm
by IdeasVacuum
Hi Marc

....potentially, the OpenGL Gadget would work better with large meshes - that is one reason why most of the CAD-CAM community is using OpenGL.

Re: yes, next step, next problem, WorldShadows()

Posted: Tue Jul 16, 2019 3:16 pm
by marc_256
Hi IdeasVacuum,

This are my compiler settings

Image


What I want to know now, is this PB limit problem or OGRE limit problem ?

thanks,
marc

Re: yes, next step, next problem, WorldShadows()

Posted: Tue Jul 16, 2019 3:46 pm
by falsam
Hello Marc

Use InitEngine3D(#PB_Engine3D_DebugLog) and look at the file Ogre.log

The subsystem OpenGL is a solution (Water creation does not work with the OpenGL subsystem).
You can also install DirectX9c end user. This is what I did with Windows10 :wink:

Re: yes, next step, next problem, WorldShadows()

Posted: Tue Jul 16, 2019 3:53 pm
by marc_256
Hello falsam,
thanks for the tip ... go to try it in a second.

@IdeasVacuum
do you mean I need to learn OpenGL to use the OpenGL gadget ? :evil: :twisted:

marc

Re: yes, next step, next problem, WorldShadows()

Posted: Tue Jul 16, 2019 5:47 pm
by Samuel
marc_256 wrote: When I test the PB examples, they works very well ...
And with my robot meshes noting is working.

And yes, all my meshes of the robot are very high poly entity's ...
So, thank you, now I know why PB is not working at all.

Is this a OGRE problem or a PB problem ?
And can this be updated ?
Hmm, sounds like you are exceeding the limit. The PB team could change the buffers to 32 bit internally. It should solve the crashing. The problem would be that stencil shadows aren't meant for high poly meshes. Performance wise you'll be getting major slowdowns the larger the mesh.
Instead you could try breaking up your robots into smaller entities which should allow the stencil shadows to work. Try keeping each entity at or below 30000 vertices/faces.

You could also try texture shadows which are faster than stencils but then you are limited to entities being casters or receivers. They can't be both at the same time. Reason being is these texture shadows are using a simple technique with no depth system which is way self shadowing is not possible.

Re: yes, next step, next problem, WorldShadows()

Posted: Tue Jul 16, 2019 8:04 pm
by marc_256
To find out where the problem is,
I eliminated almost all parts except some ...

here the result

Image

Seems to work well, with a very limited number of entity's.
The PB team could change the buffers to 32 bit internally.
So yes, need 32 bits ...


marc

Re: yes, next step, next problem, WorldShadows()

Posted: Tue Jul 16, 2019 8:34 pm
by IdeasVacuum
....and 64bit buffers on 64bit OS?

Re: yes, next step, next problem, WorldShadows()

Posted: Tue Jul 16, 2019 11:41 pm
by IdeasVacuum
do you mean I need to learn OpenGL to use the OpenGL gadget ?
Well it's similar - especially in terms of how confusing and difficult it can be to get materials to look real :mrgreen:
However, there is a lot of OpenGL information online, because it is so popular. It's possibly more appropriate for your project as the sub-set of Ogre that PB supports is more in the direction of Games rather than Engineering.

I do wish Fred had added a raft of functions at the time the OpenGL Gadget was introduced. One thing in it's favour is the seamless movement of the mouse between the OpenGL gadget and any other gadget, without requiring extra code to track the mouse. If only there was an Ogre Gadget........

Re: yes, next step, next problem, WorldShadows()

Posted: Tue Jul 16, 2019 11:53 pm
by Samuel
IdeasVacuum wrote: ....and 64bit buffers on 64bit OS?
That might be a bit overkill. 32 bit buffers alone would increase the count from 65536 to 4294967296 per entity.

@marc_256
Did you model those entities using an external software like blender? If you have the xml exports of them you can manually change the use32bitindexes="false" to "true". That might solve the stencil shadow issues you are having.
With my custom exporter I've imported meshes into PB/OGRE that had a couple hundred thousand polys. I don't remember if I ever tried them with stencil shadows though.

Re: yes, next step, next problem, WorldShadows()

Posted: Wed Jul 17, 2019 1:24 am
by box_80
Have the option to use 16 or 32 bit buffers for a entity would be nice to have depending on what the project needs.

Re: yes, next step, next problem, WorldShadows()

Posted: Wed Jul 17, 2019 4:51 am
by applePi
try MeshLab tool
there are options to reduce the number of vertices and faces, look this option:
Filters -> cleaning and repairing -> merge close vertices
Image
but this page is better: https://www.shapeways.com/tutorials/pol ... th_meshlab since they don't accept more than 1 million polygons for 3D printing, they describe how to reduce it in detail
it is possible that blender also can reduce the number of vertices and faces, search for "how to reduce number of vertices in blender"
i have an old 32bit version of meshLab, but in their site seems they provide only 64bit version
http://www.meshlab.net/

Re: yes, next step, next problem, WorldShadows()

Posted: Wed Jul 17, 2019 8:39 am
by marc_256
Samuel wrote:
IdeasVacuum wrote: ....and 64bit buffers on 64bit OS?
That might be a bit overkill. 32 bit buffers alone would increase the count from 65536 to 4294967296 per entity.

@marc_256
Did you model those entities using an external software like blender? If you have the xml exports of them you can manually change the use32bitindexes="false" to "true". That might solve the stencil shadow issues you are having.
With my custom exporter I've imported meshes into PB/OGRE that had a couple hundred thousand polys. I don't remember if I ever tried them with stencil shadows though.

Did some tests, can be me but it seems, not the polys per entity is the problem,
but the total amount of polys of all entity's together !!!
I will do some extra tests ...

1) I use a CAD program to build and develop the mechanical parts, and export them via COLLADA

2) I import them in BLENDER to position, and give them a material, and export them via OGRE exporter.
and get a Geometry.mesh.xml file. Who I convert to a vertices / face data file.

3) I integrate this file in to my PB program.


marc