Page 1 of 1

BillboardSet how to use

Posted: Tue Oct 31, 2017 8:58 pm
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
}

Re: BillboardSet how to use

Posted: Wed Nov 01, 2017 12:11 am
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