howdy once again …
i used the last week trying to implement a terrain as descriped in the gamasutra article [ insert link here … have forgotten my username at gamasutra … 'll add this when i’m back at my pc ]
i know there is a terrain rendering mechanism in xith … but i’d like to try and learn doing things myself
so … now i came across some problems:
the gamasutra mechanism doesn’t store any per-vertex data to improve memory usage
what i tried to implement is an instance of GeomDataInterface which is able to return my coords … but there is no possibiliy to add these to GeomContainer or TriangleArray so i put a setCoordsDataInterface method in GeomContainer …
i got to the point that i had my coordData on screen …
but … oh no … they were all white and stuff … so i looked at the source and found out i had to implement several GeomDataInterfaces for coords, normals, texCoords etc …
so i build a structure which served several GeomDataInterfaces as a data source ( this was in fact a bin tree + linked list structure thingy which i spend a whole day debugging cause i’ve mixed up some pointers …
)
when this was done … i was happy … and tried to run the whole thing … and … it didn’t work …
i decided that this wasn’t the way of doing this …
the next thought was to keep the per vertex data once rendered … which reduced calculation times but had a large hit on memory
i use a NodeUpdater that calles the recursive rendering methods which then put there data into an instance of TriangleArray ( actually into TriangleArray.coords, .texCoords and .normals which are implementations of GeomDataInterface if i remember correctly )
this puts my vertex data into several FloatBufferS which i get initialized which a fixed size ( i don’t really understand how this thingys work … but i believe they reserve the full size in memory which is not desirable in this case )
the introduction on http://xith.org states that xith is supposed to be able to access the gl calls directly … i searched through this forum and found this to be not possible without modifying xith’s source …
as i have mentioned in some other posts already i have a lot of spare time at the moment … so i’ll try to fix this …
if i understand Will’s ‘explanation of xiths render pipeline’ correct a RenderAtom holds all the data necessary to render anything
so i guess the easiest way to let the user pass stuff down the render pipeline would be to implement a Node that holds a predefined RenderAtom which got wrote by the user
implementing this as a Node in the scenegraph gives the user access to some features like Behaviors and/or Updaters that get called through the scenegraph
i don’t know if this is all there is to do … any thoughts on this?