# Billboards texture

**URL:** <https://discourse.libcinder.org/t/billboards-texture/1992>\
**Category:** Using Cinder\
**Created:** [May 9, 2022, 5:16pm UTC](https://discourse.libcinder.org/t/billboards-texture/1992 "2022-05-09T17:16:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![azerty69](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@azerty69](https://discourse.libcinder.org/u/azerty69)\
**Post date:** [May 9, 2022, 5:16pm UTC](https://discourse.libcinder.org/t/billboards-texture/1992/1 "2022-05-09T17:16:09Z")

</div>

Hello,

I’d like to use point sprites in my program. I see the quads when I use  
the drawBillboard() method but they are not textured. Here is my code:

vec4 psPos[NBR\_POINT\_SPRITES];  
TextureRef psTex;  
(…)  
for (int i = 0; i \< NBR\_POINT\_SPRITES; ++i)  
{  
double x = -2. + (rand() % 40) \* .1f;  
double y = (rand() % 120) \* .1f;  
double z = -2. + (rand() % 40) \* .1f;  
double speed = (rand() % 20) \* .1f;  
psPos[i] = vec4(x, y, z, speed);  
}

```
psTex = Texture2d::create(loadImage("data/ps.png"));

```

(…)  
vec3 mRight, mUp;  
viewCam.getBillboardVectors(&mRight, &mUp);

```
gl::enableAlphaBlending();
gl::color(ColorA(1.f, 1.f, 1.f, .75f));
psTex->bind(); // bind the point sprites texture

for (int i = 0; i < NBR_POINT_SPRITES; ++i)
{
	gl::drawBillboard(vec3(psPos[i].x, psPos[i].y, psPos[i].z), vec2(.25f, .25f), 0.f, mRight, mUp);
}

psTex->unbind();
gl::disableAlphaBlending();

```

Any help will be appreciated,  
azerty69

---

<div class="post-metadata">

**Author:** ![lithium](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/lithium/32/38_2.png) [@lithium](https://discourse.libcinder.org/u/lithium)\
**Post date:** [May 9, 2022, 11:11pm UTC](https://discourse.libcinder.org/t/billboards-texture/1992/2 "2022-05-09T23:11:11Z")

</div>

Do you have a shader bound? Try adding this where you bind you texture.

```cpp
gl::ScopedGlslProg shader { gl::getStockShader ( gl::ShaderDef().color().texture() ) };

```

---

<div class="post-metadata">

**Author:** ![azerty69](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@azerty69](https://discourse.libcinder.org/u/azerty69)\
**Post date:** [May 10, 2022, 9:50am UTC](https://discourse.libcinder.org/t/billboards-texture/1992/3 "2022-05-10T09:50:58Z")

</div>

> [@lithium](#):
>
> `gl::ScopedGlslProg shader { gl::getStockShader ( gl::ShaderDef().color().texture() ) }`

Hello lithium,

Your suggestion has solved the problem. I was thinking that the method ‘drawBillboard’ was doing  
the job for me, like gl::draw(Texture2dRef tex).

Thank youi very much,  
azerty69
