alpha face sorting inside single mesh? 2004-03-29 - By Mads Rydahl
Back
>>> colin@(protected) wrote: > I argue with people sometimes about frame rates. Try it at 30 fps, > I'm sure it'll still be fun, and will work on a wider range of > machines, or will allow you to do even nicer game play or graphics.
It could turn out to be a long and unfruitful argument, but some would argue that we've been missing constant 50fps frame rates without tearing since we stopped playing our c64s ;-)
> You don't have to rebuild a mesh. Just change the > model.vertexlist[entry] and it will update without having to do a > build.
Is this true for shader assignment as well? I had some problems swapping the individual shaders of each face, and it seemed like the only way to get them updated was to run another build().
> Your textures look like they may not be powers of 2 in size.
You're absolutely right. Currently, the textures are stored in the resolution suitable for the online 2d sprite version, and are scaled to an odd size only for these test purposes. But what are the problems/disadvantages of using non power of two sizes? Will they get interpolated when sent to the gfx card?
> I think that the z-ordering is done on a model basis when dealing > with transparent textures. Are your explosions in the same mesh? > Maybe you could replace the shader for two faces with an explosion > image, instead of having the explosion as another model.
Everything is currently displayed as a single mesh within a single model. I am just swapping the shaders (and offsetting the vertex coords) on the faces that show the explosions. They are not the same faces as the objects that explode, though. I need to display the explosion in front of the objects, so I have set aside the last 100 faces of the model to display overlays when needed.
> You would expect the textures to draw in shader order for one model, > but I'm not sure. What happens if you build the mesh and shaders from > bottom to top?
They do appear to draw in shader order, but how does sw3d determine which shader's faces to draw first? And is there a way to force shader order, or will I have to use the same shader for all faces and swap texturecoods to be in full control?
In my screenshot'ed example, any basic sorting approach would determine that the faces assigned to the explosion shader are closer in z than all of the rest, and the fact that the mesh has been tampered with can be ignored, since I'm currently rebuilding the mesh every frame.
> The game is potentially awesome by the way, and would certainly fit > in well with someone like shockwave.com (all their games are > basically connect the colored blocks, with some very novel > variations).
Thanks :-) I believe that shockwave.com is one intended market, but my client will handle that side of things.
/mads
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ Dir3d-l mailing list Dir3d-l@(protected) http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l
|
|