PDA

View Full Version : Why are helpers so slow compared to geometry objects?


scorpion007
06-30-2007, 04:39 AM
If I make a helper plugin which makes a low-res sphere, with this getDisplayMesh function,
and I make a fair amount of them, it starts to *REALLY* lag (in the viewports, etc).

Whereas, I can make a larger amount of higher-res geometry spheres, and it will still be blazing fast!


on getDisplayMesh do
(
if (meshObj == undefined) then
(
meshObj = createInstance sphere radius:radius segs:12
lastRadius = radius
)
if radius != lastRadius then
(
meshObj.radius = radius
lastRadius = radius
)

meshObj.mesh
)



Is there any way I can make it faster?

marktsang
06-30-2007, 10:14 AM
hey man,
i asked the exact same question a few months ago, got no reply :(
http://forums.cgsociety.org/showthread.php?f=98&t=495498&highlight=extended

mark

scorpion007
06-30-2007, 10:33 AM
Hey,

Heh, missed your thread. Guess I'm not the only one with the problem.

Hope Bobo knows ;)

d3coy
06-30-2007, 04:00 PM
Hi guys, I don't know for sure, but I think graphics cards are highly accelerated for geometry, whereas drawing lines is a little bit slower. It could be that or it could be that providing a mesh through MXS is just inherently slower than an actual c++ mesh object. I'd like to know the actual reason too.

marktsang
06-30-2007, 05:57 PM
hey d3coy,
i dont think its because drawing lines is faster... if you use the standard point hellpers or dummys there is no slow down even with hundreds of them,

i think it is most likely the "on getdisplaymesh" handler being called too often that cause the slow down, unfortunatly there doesnt seem to be another way to hand the plugin a mesh to use for drawing the lines.......

thatoneguy
06-30-2007, 10:03 PM
Couldn't you use a green sphere primitive with "display as wireframe" checked in its properties?

magicm
06-30-2007, 11:01 PM
Like james already said, it's probably because the regular primitives are compiled as C++ plugins, which obviously evaluate much faster. 16 times slower (as Mark noticed) is a bit much though...

Martijn

CGTalk Moderation
06-30-2007, 11:01 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.