Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology
Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered
You are not logged in.
Pages: 1
I'm running a big scene (more than 500000 pol) , and having low frame rate only when moving the cursor, is there a raycast process there? is there any way to accelerate it?
Offline
Hi,
the mouse raycast is already optimized, the subentity selection is done on a rendered picture with a color by entity
the polygon raycast is done per subentity.
if your object have only one subentity and a large count of polygon we can't optimize more
Offline
Thanks Arkeon!! Sorry but i don't understand very well what the cpu and gpu does in the process, why cant the gpu make all the intersecion part with a color by entity? is there an algoritm that loops through all the polygons of an entity? what is the diference between entity and subentity in openspace?
Offline
Hey,
Indeed, there's a raycast done.
But in fact, we had already boosted it the better way I know, ie with a selector buffer. The principe is very simple, and consist in rendering the scene a second time on a texture, and to set a unique colour by "sub-entity". A sub entity is not a concept that exists in OpenSpace3D, but in two words, it's a subset of an entity (an entity with 3 materials will have 3 sub-entities). So, next, we check which color is under the mouse cursor, get the sub-entity associated with this color, and then we are doing a "raycast to the polygon level" on the sub-entity triangles, to find the exact collision point with the mesh (and also get the uv coordonates and other stuff). And that's this last part that can affect the frame time, ie, if you have too many triangles on the subentity under the mouse, it'll lag...
So, to improve performance, use object with subentities that do not have two much polygons (the total polygon on the scene can stay the same, but, for example, if I have a building mesh, with one sub-entity on it, and 200K polys, it will be less effective than 10 sub-entities of 20K polys...).
You can also disable the rendering of an Entity on the color selector, meanings that the "raycasting to polygon level" will never be done on it. The Scol function is SO3ObjectSetMouseClick ("fun [SO3_OBJECT I] I"), but I don't know if an OpenSpace3D's plugit uses it (maybe "object click" plugit).
I Hope it helps.
<edit>I didn't saw your responses guys, but I think that you will find more infos in my post, let me know if it's still not clear</edit>
Last edited by Nodrev (29-Jul-2011 13:10:31)
Offline
What a helpful comunity! :-) , thank you all
It's Strange but I have a terrain composed by few polygons and with 128 512x512 textures as subentities (materials) and The slow frame rate when moving the mouse is still there (60fps without moving and more or less 32 fps moving), It's also true that with a scene without geometry the frame rate goes down to 50 (from 60) only moving the mouse, is it a normal behavement? , anyway i'll try the SO3ObjectSetMouseClick
Offline
I've tried ignoring mouse in object click with SO3ObjectSetMouseClick but it continues casting rays, maybe there is a similar function SO3ObjectSetMouseOver???
Offline
astrolabio message let me think about a way to do the casting fully on the GPU with shaders, but as we need to render a third time the scene to have the "depth" map, it should not be very efficient with the actual renderer, but feasible with a deferred renderer. A thing to keep in mind. Anyway, sorry to not answer to your problem, I don't really have time to look at it tonight...
Offline
SORRY!!!
I had tested the object click and SO3ObjectSetMouseClick but had forgot to play the scene :-), big mistake!!!
It's working !!
I've tried it over a 2.000.000 polygon sphere and without ignore it it was 0-1 fps and 50-60 fps with it
Thank you all
Offline
You are welcome.
Offline
Pages: 1