Jump to content

Question about color-attributes for ObjectBillboards


photo

Recommended Posts

Posted (edited)

Hello,

I am currently using the ObjectBillboards to create many lights for our scene. The setBillboardPosition method can set the position of an element. I was wondering if there is a similar method for color ? If not, is it possible to adjust or create a buffer (I'm thinking of attributes here) to pass these values to a self-created shader?

 

edit:

Additional question: Is it possible to disable a specific billboard? For example, suppose I want to disable billboard number 500, the only way I can find out is to remove the billboard and add it again if necessary, but this is no longer billboard 500 but number of billboards +1.

Best Regards,

Sascha

Edited by sascha.schneider
Posted

Hello Sascha,

ObjectBillboards doesn't support per billboard colors. You can set texture coordinates for a billboard though
https://developer.unigine.com/en/docs/2.9/api/library/objects/class.objectbillboards#setTexCoord_int_vec4_void
Combined with a texture atlas it should be enough for creating different colored billboards

16 hours ago, sascha.schneider said:

Is it possible to disable a specific billboard?

A specific billboard can not be disabled, it only can be removed.

16 hours ago, sascha.schneider said:

I want to disable billboard number 500, the only way I can find out is to remove the billboard and add it again if necessary, but this is no longer billboard 500 but number of billboards +1.

When you delete and add back a billboard the number of all billboards increases? It sounds like a bug. Could you provide a small reproducing sample?

Posted
On 10/2/2019 at 8:07 AM, andrey-kozlov said:

When you delete and add back a billboard the number of all billboards increases? It sounds like a bug. Could you provide a small reproducing sample?

Hello andrey,

I meant that the index corresponds to n+1 and not the number is wrong. It remains that it is the correct number of billboards, but the added billboard now has the last index and no longer the previous one. Which is also correct from the Api, but doesn't give me the possibility to assign an index to a specific billboard and thus prevent the possibility to switch it on and off.

Thank you for your answer, 

Regards,

Sascha

Posted

Hello Sascha,

I'm afraid the only way to disable a specific billboard and keep the index is to make it invisible during rendering with some hacky way. You could position it in some invisible place (boundbox will increase accordingly) or add transparent textures to your texture atlas for that case.

×
×
  • Create New...