[SOLVED] billboard culling based on distance thinks its...

Problems building or running the engine, queries about how to use features etc.
Post Reply
SuperNess
Kobold
Posts: 39
Joined: Wed Feb 12, 2014 12:52 am
x 9

[SOLVED] billboard culling based on distance thinks its...

Post by SuperNess »

hi all,

I'm creating billboards for grass and other small doodads on the terrains. however I have a problem - when culling, the billboard thinks of itself as positioned (0, 0, 0), and it culls all billboards in the billboard-set whenever the camera is too far from that point.

I set individual culling to true (boardset->setCullIndividually()) and even set bounds manually (boardset->setBounds()), but as long as I set the billboard-set maximum rendering distance (boardset->setRenderingDistance()), it will cull ALL billboards once the distance between the camera and position 0,0,0 is greater than max rendering distance.

how do I solve this? how do I tell the billboard-set its position?
(note: all billboards in a billboard set are close-by, they are not scattered all over the map. so I just need to tell the billboard set its "center" position and it should be ok)

thanks!
Last edited by SuperNess on Tue Mar 10, 2015 1:30 pm, edited 1 time in total.
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4304
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 135
Contact:

Re: billboard culling based on distance thinks its position

Post by spacegaier »

Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
SuperNess
Kobold
Posts: 39
Joined: Wed Feb 12, 2014 12:52 am
x 9

Re: billboard culling based on distance thinks its position

Post by SuperNess »

I've seen that post, but its not the same problem.
first, billboard/billboardset don't even have setBoundingBox(), but as I mentioned, I did use setBounds(). secondly, I don't want to disable distance/frustum culling completely, that would be extremely inefficient. frustum culling works, only distance culling causing the issue and if I wanted to disable it I would just use setRenderingDistance(0) and my problem is fixed.

anyway meanwhile I found that the distance culling is based on the node's position, so I just put the billboard set in a node and set the node position. I would still appreciate a way to do it without the node (which is totally useless except for solving this issue) but the problem is more or less fixed.

thanks anyway, next time please give a little more credit to the community members. most of us know how to use search :)
N0vember
Gremlin
Posts: 196
Joined: Tue Jan 27, 2009 12:27 am
x 24

Re: billboard culling based on distance thinks its position

Post by N0vember »

SuperNess wrote: anyway meanwhile I found that the distance culling is based on the node's position, so I just put the billboard set in a node and set the node position. I would still appreciate a way to do it without the node (which is totally useless except for solving this issue) but the problem is more or less fixed.
Why do you feel like you need to get rid of the Node ? Are you worrying about the overhead ?
A node is not "useless" : its role is precisely to set something's position.... Depending on which version you are using, it's even the only way to go.
In the last versions of Ogre (2.0 and 2.1) positions are always to be set on the node and not on the objects anymore. It makes sense when you think of a scene graph, that the nodes and only the nodes hold transform information.
So if I was you I'd consider this solved :)
SuperNess
Kobold
Posts: 39
Joined: Wed Feb 12, 2014 12:52 am
x 9

Re: billboard culling based on distance thinks its position

Post by SuperNess »

well, I was thinking many doodads = many billboards = many extra nodes = wasteful.
I see your point about it being the right way to do it, I just thought there was an alternative since billboards can set position individually. although skipping the node and setting bounding manually does sound a bit like a hack now that I say it out loud. :lol:

thanks.
Post Reply