Page 1 of 2

Where are the Vertices? + DelURU Development

PostPosted: Fri Aug 05, 2011 11:29 am
by Stucuk
Could someone tell me which "Class" from a PRP contains the vertices? The plSpans don't seem to contain any vertex information....

Re: Where are the Vertices?

PostPosted: Fri Aug 05, 2011 3:36 pm
by Branan
vertex data is in plDrawableSpans. They're stupidly complicated, if you need a bit more help figuring them out let us know.

EDIT: Technically, it's in plGBufferGroup, but you need the information from the Icicles (a subclass of plSpan) in order to be able to use them. plDrawableSpans is the overall container class for drawable data.

Re: Where are the Vertices?

PostPosted: Fri Aug 05, 2011 4:18 pm
by Stucuk
I was hoping you weren't going to say they were hidden in there. I wish Cyan made class/variable names more descriptive, i would never have guessed that class would contain vertex information based on its name. Thanks for the information, i will try and see if i can work it out.

Re: Where are the Vertices?

PostPosted: Fri Aug 05, 2011 8:15 pm
by Branan
I may make a blog post about DSpans in the near future - I've been trying to think of a bit of Plasma I can write a technical post on, and DSpans are both self-contained and typically need some explanation before people figure them out.

I'll post a link here when/if that post gets finished.

Re: Where are the Vertices?

PostPosted: Fri Aug 05, 2011 11:34 pm
by Stucuk
Is the fParticleSpans related code* in plDrawableSpans::Read redundant? The only thing which seems to add to it is linked to plParticleSystem::ICheckDrawInterface** which seems(Based on my proberly flawed understanding of the code) to be only called before/during rendering and after an age has loaded, both of which should be after plDrawableSpans::Read has been called.....


*
plDrawableSpans::Read Show Spoiler

** plParticleSpan *plDrawableSpans::ICreateParticleIcicle is the bit which adds to fParticleSpans but ICheckDrawInterface is the highest "level" procedure i could find.

P.S I look forward to reading your post when/if it is posted.

Re: Where are the Vertices?

PostPosted: Tue May 15, 2012 9:27 am
by Stucuk
Image

Made some progress, currently its just rendering the Vertex's (I haven't written code to load materials/layers). Seems to be rendering correctly, though i haven't been able to work out what matrix your meant to apply(Im guessing its something to do with the Coordinate Interface's).

Re: Where are the Vertices?

PostPosted: Tue May 15, 2012 11:37 am
by Sirius
Wow, nice !!

I worked a bit on Drawable Spans too, and they are not easy at all to read (ok, it is not supposed to be read by anything else than plasma itself, but still...).
Extracting any object from them is a real pain (that's what I was trying to do, before Dustin made his distillation tool available in the command line of Drizzle).
Before we get a better post about it from Branan, you might want to check these forums - there are some useful infos in them.
Here and here.
Have fun messing with it :P .

Re: Where are the Vertices?

PostPosted: Wed May 16, 2012 7:26 pm
by Stucuk
Thanks for the links. I thought the space tree would be a type of Potential Visibility Set(Currently im not actually loading it, skipped onto the rendering :P).

Image Image

Implemented Layer + Material loading code as well as basic rendering of them(Very basic as it only uses the first layer of a material and ignores all its flags). Im cheating when it comes to Transparency by using GL_SAMPLE_ALPHA_TO_COVERAGE_ARB so i don't have to sort the vertex's(Though the transparency is not as nice).

Note: The transparent red bits are layers which are not pllayers(pllayers is the only type it can load currently).

Re: Where are the Vertices?

PostPosted: Wed May 16, 2012 9:55 pm
by Branan
A bit more info on the spacetree: It's implemented as a BVH, which is fairly simple to build/traverse but not as efficient as the BSPs and octrees that most other engines use. The PlasmaClient code is probably a good example of how to use it. I'm not sure I ever put that code on github, but it's still on Zrax's server

One thing to keep in mind is that if you implement kickables or animations, you'll need to rebuild the spacetree as objects move around. I never implemented this in PlasmaClient, so your only reference for how to do that is going to be CWE itself.

Re: Where are the Vertices?

PostPosted: Thu May 17, 2012 8:00 pm
by Stucuk
The reason why the Coordinate Interface's LocalToWorld matrix (As well as the layers Transform matrix for textures) didn't work right was due to me loading the matrix's the wrong way around. Doh. Now objects are in the correct places and textures for the most part seem to have the right texture coords.

@Branan: Thanks. I currently don't know if it will ever get to the stage of having Physics(Well an avatar which walks around and interacts with the world). My plan is to make it able to load the PRP's fully(With visual renderings of the prp classes where possible to check that its all loaded correctly) and then see what happens. Id love to make a Age Maker(Map editor) at one stage (One which doesn't require any modelling knowledge, where you can raise/lower land to create height-maps for the terrain coupled with the ability to place prefab objects (Like rocks, trees, etc)) but it would take up alot of time.