Forums > Jitter

jit.gl.model: several groups drawn at the same time

November 10, 2010 | 10:30 pm

Hi,
I’m playing with a huge amount of 3d models.
Each .obj file, loaded in my jit.gl.models, is containing also several groups of object.
I wondered if it was possible to ask the jit.gl.model to display several groups at the same time without creating them previously in a 3d editing software. (where creating all the possibilities between my groups would be impossible or really burdensome)
So how to send a message like [drawgroup 1, 2, 6, 12, 20, 25] for example
thanks again.


November 11, 2010 | 12:17 am

Use jit.gl.model @automatic 0, and manually send the drawgroup message for each group on each render bang.


November 11, 2010 | 3:15 am

thanks Joshua but i’m not shure to understand:
Here is an example patch where I’m trying to send drawgroup 1 and 2 on each bang. Under the automatic 0 argument, nothing appears at all

– Pasted Max Patch, click to expand. –

November 11, 2010 | 3:52 am

Your patch is 99% correct. You just need to change your message boxes "drawgroup N" to "drawgroup N, bang". The drawgroup message sets which group to draw, and the bang (or draw) message does the drawing.


November 16, 2010 | 2:59 am

HI.
Thanks, I got it.
I drawn several instances of 3 d models with different drawgroups orders. I used the poly solution because it does not seem to be possible with jit.gl.multiple.
The problem is that the framerate considerably drops
I have 25 models with a choice of nearly 30 groups inside. I’m using a MBP 2,26ghz with 4giga of RAM.
the framerate is allways under 20 fps..
Do you have any idea about how to improve this rendering?
thanks.

here is my poly content ( sorry I know it’s not well made)

– Pasted Max Patch, click to expand. –

November 16, 2010 | 3:52 pm

Today, I notice that even with 10 poly’s loaded, the framerate is at 13 fps…
does it come from the big amount of bangs created in my subpatch?


November 16, 2010 | 10:15 pm

I really don’t know how to improve that.
my cpu is free at 90 %…..
please help….


November 16, 2010 | 11:41 pm

Please provide a complete example as a zip file with an example model and your master patch. This poly sub-patch is not enough for us to comment further.


November 17, 2010 | 3:34 am

ok, here are the patches and the .obj example.
thanks for your help once again

Attachments:
  1. files.zip

November 17, 2010 | 7:18 pm

The biggest cost is that when changing drawgroups, we rebuild the displaylist, rather than having a separate displaylist for each group. This isn’t avoidable at the moment, even with other @mode settings. We can look at making this better in the future, but for now, I would recommend you use an instance of jit.gl.model for each drawgroup without changing it and draw each one separately.


November 17, 2010 | 8:49 pm

thanks joshua.
Sorry, I did not realy inderstand the solution you proposed..
You advice me to put in my poly, as many jit.gl.model as drawgroups I had previously and send a drawgroup for each?
I also thought using texmap to display parts or not. will it be the same problem?
the thing thtat i would need in this case would be to blacken the rest of the object that is not textured…..
is it possible?


October 20, 2011 | 7:15 pm

Hello Joshua.
I come back to this topic, wondering if the new max 6 beta version proposed a better way to manage drawgroups messages in multiple jit.gl.model objects.
Are jit.gl.multiple or poly objects more flexible in the current beta?
It would be great to manage arrays of 3d objects without creating one intance of jit.gl.model for each drawn 3d model.
Thanks


October 20, 2011 | 7:56 pm

i’m not entirely sure what you are trying to do, but the new jit.gl.model object now supports instancing. meaning you can share mesh data from a single buffer, to draw several instances of an object with individual transforms.

your modeler and exporter must handle the instancing export, and the file-type must support it.
maya and collada are one example of modeler and file-type that supports this.

you can control individual instances by binding jit.anim.nodes to them.
there will be examples on how to do this in the Max 6 release version.


October 20, 2011 | 9:05 pm

Sorry, If I was not clear:
When creating this topic a few month ago, I wanted to multiply 30 times the content of a single jit.gl model.
In the meantime, I wanted to control each instance of this model independantly.
Moreover , each instance of my .obj file had many groups I would have controled with drawgroup messages.
Doing this with jit.gl.multiple was impossible and managing several instances via a poly object decreased the frame rate. So I had to manually create as many jit.gl.model as I desired, and sent them different drawgroup message.
My patch was really big and not very efficient.
The solution you gave seems interesting, I’m looking forward to get some examples.
Where can I check the supported files? I’m using C4D at the moment.
thanks Robert.


Viewing 14 posts - 1 through 14 (of 14 total)