yes, next step, next problem, WorldShadows()

Everything related to 3D programming
marc_256
Enthusiast
Enthusiast
Posts: 742
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

yes, next step, next problem, WorldShadows()

Post 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
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

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

Post 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.
marc_256
Enthusiast
Enthusiast
Posts: 742
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

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

Post 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
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

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

Post 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.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
marc_256
Enthusiast
Enthusiast
Posts: 742
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

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

Post 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
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
User avatar
falsam
Enthusiast
Enthusiast
Posts: 630
Joined: Wed Sep 21, 2011 9:11 am
Location: France
Contact:

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

Post 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:

➽ Windows 11 64-bit - PB 6.0 x64 - AMD Ryzen 7 - NVIDIA GeForce GTX 1650 Ti

Sorry for my bad english and the Dunning–Kruger effect.
marc_256
Enthusiast
Enthusiast
Posts: 742
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

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

Post 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
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

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

Post 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.
marc_256
Enthusiast
Enthusiast
Posts: 742
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

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

Post 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
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

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

Post by IdeasVacuum »

....and 64bit buffers on 64bit OS?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

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

Post 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........
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

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

Post 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.
box_80
Enthusiast
Enthusiast
Posts: 111
Joined: Mon Sep 03, 2012 8:52 pm

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

Post 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.
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

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

Post 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/
marc_256
Enthusiast
Enthusiast
Posts: 742
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

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

Post 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
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
Post Reply