# PNG texture not coming as expected on material

**URL:** <https://forum.babylonjs.com/t/png-texture-not-coming-as-expected-on-material/50937>\
**Category:** Questions\
**Tags:** material, texture, textures\
**Created:** [May 30, 2024, 6:25am UTC](https://forum.babylonjs.com/t/png-texture-not-coming-as-expected-on-material/50937 "2024-05-30T06:25:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SAURABH\_CHADHA](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/saurabh_chadha/32/21254_2.png) [@SAURABH\_CHADHA](https://forum.babylonjs.com/u/SAURABH_CHADHA)\
**Post date:** [May 30, 2024, 6:25am UTC](https://forum.babylonjs.com/t/png-texture-not-coming-as-expected-on-material/50937/1 "2024-05-30T06:25:35Z")

</div>

I have added a png image on texture using the below code, :

```auto
            // Create a material with the image texture
            var planeMaterial = new BABYLON.StandardMaterial("imageMaterial", scene);
            
            planeMaterial.diffuseTexture = new BABYLON.Texture("products/tshirt1.png", scene);
            plane.material = planeMaterial;
            
            (await scene).getMaterialByName("imageMaterial").emissiveTexture = new BABYLON.Texture("products/tshirt1.png")

```

It should come like this:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/5/d/5d7531c5a263ae956add273f629e0df40929204b.jpeg)

But it is coming like this:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/8/38c42d4c4febdf03a08486c8ab7aec7769a81673.jpeg)

What is needed to be done in my code ?

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [May 30, 2024, 7:38am UTC](https://forum.babylonjs.com/t/png-texture-not-coming-as-expected-on-material/50937/2 "2024-05-30T07:38:14Z")

</div>

You need to change opacity and not emissive

see [Babylon.js docs](https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering#categorizing-meshes)

I guess you double checked the texture to have an alpha channel?

---

<div class="post-metadata">

**Author:** ![SAURABH\_CHADHA](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/saurabh_chadha/32/21254_2.png) [@SAURABH\_CHADHA](https://forum.babylonjs.com/u/SAURABH_CHADHA)\
**Post date:** [May 30, 2024, 7:46am UTC](https://forum.babylonjs.com/t/png-texture-not-coming-as-expected-on-material/50937/3 "2024-05-30T07:46:35Z")

</div>

It is solved. Thanks

I have used this code:

```auto
    const plane = BABYLON.CreatePlane("shirt")
    const texture = new BABYLON.Texture("https://playgrounds.babylonjs.xyz/tshirt1.png")
    const material = new BABYLON.StandardMaterial("mat")
    material.diffuseTexture = texture
    material.emissiveTexture = texture
    plane.material = material

    texture.hasAlpha = true // <----

```
