BillboardSet how to use

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
Hotshot5000
OGRE Contributor
OGRE Contributor
Posts: 263
Joined: Thu Oct 14, 2010 12:30 pm
x 69

BillboardSet how to use

Post by Hotshot5000 »

So I create a billboardset with a pool of 1 (I only need one billboard) and it looks like I need to do:

Code: Select all

billboardSet.beginBillboards(billboardSet.getNumBillboards());
        billboardSet.endBillboards();
        billboardSet.setDatablock(mDatablock);
for it to work since I need to force the buffers' creation before I am allowed to set the datablock (for some reason). After getting this out of the way I have the following error:
"Vaos meshLod/shadowLod not set. "
"Note: If this is a v1 object, it is in the wrong RenderQueue ID "
"(or the queue incorrectly set)."
This happens because the SceneManager::cullFrustum() tries to add this v1 object using the addRenderableV2() method and of course fails.

Any idea how to make it reach addRenderableV1() because I am not seeing it in the cullFrustum() from SceneManager.

The material file that is used for the datablock is this:
abstract hlms BaseSettingsAlphaBlend unlit
{
scene_blend alpha_blend
depth_check off
depth_write off
cull_mode none
}

hlms Fx/ExplosionMaterial unlit : BaseSettingsAlphaBlend
{
diffuse_map explosion0.png
}
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5588
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1413
Contact:

Re: BillboardSet how to use

Post by dark_sylinc »

for it to work since I need to force the buffers' creation before I am allowed to set the datablock (for some reason).
For billboards (and particles, and everything based on billboards), you need to set the hlms datablocks by name, not by pointer. Explanation is here: viewtopic.php?f=25&t=84897#p523221
After getting this out of the way I have the following error:
Do the following:

Code: Select all

uint8 rqId = ...;
//Set the the RenderQueue "rqId" to v1 mode (fast mode, no low level materials there, no v2 objects there either).
//Do this only once.
sceneManager->getRenderQueue()->setRenderQueueMode( rqId, RenderQueue::V1_FAST );
//Set the billboard to the same RQ we set to V1_FAST
billboardSet->setRenderQueue( rqId );
By default, only RQ 0 is actually in v2 mode; so only setting billboardSet->setRenderQueue( 1 ) should work in theory.

Do not mix v1 and v2 objects in the same queue.

Cheers
Matias
Post Reply