Looking for huge (mpd) models


Re: Looking for huge (mpd) models
#23
Ben Supnik Wrote:
Roland Melkert Wrote:I use a single set of VBO's per brick (triangles, edges, indices), these have no color component at all. I just issue a plain glColor before the drawelements call.

How do you handle parts like 122c01, where the the plate is user-colored, the wheels are red, and the axle is..metalic I guess? In BrickSmith the color is tagged as a mix of red, metalic, and user-set. If you pass immediate mode color I would think you'd need (at a minimum) 3 draw calls and some side data to tell you which part of the VBO gets which color.

Note: it's been a really long time since I wrote LDView's current rendering code, so I could be mis-remembering.

I think LDView behaves similarly to what Roland describes. It splits the geometry into two VBOs per part: one with hard-coded colors, and one for geometry of color 16. It then uses glColor before drawelements for the color 16 geometry, and none of that geometry includes color data in the vertex data. For the hard-coded colors, the vertex data includes the color data, and that is drawn in a second call. So, there will always be two calls for parts that contain non color 16 geometry, but only one call for parts that are purely color 16.
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Re: Looking for huge (mpd) models - by Travis Cobbs - 2013-03-04, 18:47

Forum Jump:


Users browsing this thread: 2 Guest(s)