Well, clipping might be a bit much to say, really.
I'm having a planet, and now I want to draw some surface markers and labels on it. I don't want to do this with billboards, because they'll be much too large when zoomed in, or much too small when zoomed out. ITextSceneNode seemed pretty much what I needed... except ITextSceneNodes don't recognise when they're behind something, in which case the label should not be drawn (i.e. if the spot on the surface is behind the planet from the camera).
I tried to make a custom text scene node to get the functionality I need. It doesn't need to be fancy. Just when the position of the marker is behind the planet, don't draw the label.
I tried it with simple line of sight collision detection. That works, but we're talking hundreds of markers here... The whole thing slowed down to a crawl.
So what I'd need is to somehow get the node into the Z-order during the drawing. Again, that doesn't sound too complicated, after all it's just one single point per marker that decides if the whole thing gets drawn. So I thought about just drawing a vertex at the marker position, that would be in the z-order...
But then I wouldn't know how to get any feedback on whether the vertex was drawn or not to decide whether or not to draw the text, so that doesn't seem to help me much.
What would you suggest to solve the problem?
Making a textscenenode clip?
Re: Making a textscenenode clip?
Single point, hm, I have heard that somewhere
Point sprites act that way, and their size is specified in pixels by default. So pretty much perfect fit, as long as your text doesn't change too often.
Point sprites act that way, and their size is specified in pixels by default. So pretty much perfect fit, as long as your text doesn't change too often.
Re: Making a textscenenode clip?
The text never ever changes, so that shouldn't be a problem. Just... what are point sprites?
Re: Making a textscenenode clip?
They are a primitive like tris and quads.
Re: Making a textscenenode clip?
Hmmm... seems to involve shader programming and stuff, which I've never done. I really didn't think those surface markers would pose such a problem...
Re: Making a textscenenode clip?
Solved the problem with a rough approximation based on distances between camera, marker and planet position in the end. Works decently and doesn't harm performance. Thanks for the replies anyways.