# Material Texture With Color Value No Effect

**URL:** <https://forum.babylonjs.com/t/material-texture-with-color-value-no-effect/3797>\
**Category:** Questions\
**Created:** [June 10, 2019, 4:17pm UTC](https://forum.babylonjs.com/t/material-texture-with-color-value-no-effect/3797 "2019-06-10T16:17:53Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [June 10, 2019, 4:17pm UTC](https://forum.babylonjs.com/t/material-texture-with-color-value-no-effect/3797/1 "2019-06-10T16:17:53Z")

</div>

Yo @Deltakosh or Anyone 🙂

In unity i have a car with a material texture **AND** and orange

Albedo Color:  
#FF4F00

Albedo Texture:

 ![Tocus_Body](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/e/e339d2ba9e68156ebae88270c36cd3dd21ffc897.jpeg)

Now when Unity renders that model… it **BLENDS** or **COMBINES** the **Albedo Color** with the **Albedo Texture** giving it a final **brownish** color…

I Unity:

 ![36%20AM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/d/d4f7694c4f6c1aa5cfcc5d4c413ef3986f11c8ad.jpeg)

But in Babylon… It like the **Albedo Color** has no effect if **that kind of** albedo texture is being used:

 ![25%20AM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/a/a066edade4b32b80da3162376a02e128794fd699.jpeg)

 ![48%20AM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/d/d851119464e5ae2f102380b36c1c2b4eb8afd086.jpeg)

Anybody know what the deal… Do we not support the same kind of material/texture/color rendering as unity does ???

I would guess that would be some shader code like albedoTexture \* albedoColor or something like that

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [June 10, 2019, 4:28pm UTC](https://forum.babylonjs.com/t/material-texture-with-color-value-no-effect/3797/2 "2019-06-10T16:28:48Z")

</div>

Pinging @sebavan

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [June 10, 2019, 4:38pm UTC](https://forum.babylonjs.com/t/material-texture-with-color-value-no-effect/3797/3 "2019-06-10T16:38:53Z")

</div>

This should work as we multiply albedoColor and Texture in Babylon. Could you share a repro in the playground (on a box it is all good) ?

---

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [June 10, 2019, 4:48pm UTC](https://forum.babylonjs.com/t/material-texture-with-color-value-no-effect/3797/4 "2019-06-10T16:48:32Z")

</div>

Yeah … I just check that same Material on a box and it works fine… Dunno what could be the issue with the Car Mesh Setup… Shit ☹

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [June 10, 2019, 6:06pm UTC](https://forum.babylonjs.com/t/material-texture-with-color-value-no-effect/3797/5 "2019-06-10T18:06:04Z")

</div>

I would need the file to be able to check, or just serialize the mesh containing the material

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [June 10, 2019, 6:07pm UTC](https://forum.babylonjs.com/t/material-texture-with-color-value-no-effect/3797/6 "2019-06-10T18:07:47Z")

</div>

it looks like there are not sphericals in the scene as we only see the specular contribution of the IBL.

---

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [June 10, 2019, 6:11pm UTC](https://forum.babylonjs.com/t/material-texture-with-color-value-no-effect/3797/7 "2019-06-10T18:11:43Z")

</div>

Yo @sebavan … Can you please take look at this file  
[https://www.babylontoolkit.com/files/MeshCarShape.glb](https://www.babylontoolkit.com/files/MeshCarShape.glb)

Can you tell why the Albedo Color has no effect on the car…

You can try the raw GLB in sandbox or whatever

---

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [June 10, 2019, 6:16pm UTC](https://forum.babylonjs.com/t/material-texture-with-color-value-no-effect/3797/8 "2019-06-10T18:16:34Z")

</div>

I cant tell if i am missing something in the Material Export or something… This is the only Mesh Setup i came across that doesn’t export with the right material setup

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [June 10, 2019, 6:20pm UTC](https://forum.babylonjs.com/t/material-texture-with-color-value-no-effect/3797/9 "2019-06-10T18:20:28Z")

</div>

The vertex color attribute is full black and use on those body parts.

---

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [June 10, 2019, 7:24pm UTC](https://forum.babylonjs.com/t/material-texture-with-color-value-no-effect/3797/10 "2019-06-10T19:24:22Z")

</div>

Now i dump Vertex Colors If they exists on the Mesh… Should i check if vertex color black or not ???

---

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [June 10, 2019, 7:31pm UTC](https://forum.babylonjs.com/t/material-texture-with-color-value-no-effect/3797/11 "2019-06-10T19:31:07Z")

</div>

Yep Vertex Colors Was Issue… If i turn them off… looks pretty 🙂

My question is, when exporting HOW do i know if i want to export Vertex Colors or not… In Unity i just check if mesh has any vertex colors and if so serialize them to GLTF… The GLTF Parser must be turning on that option of there are vertex colors present on the mesh.

So how do i determine if i should export vertex colors from Unity in the GLTF mesh ???

Thanks again for all your help 🙂

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [June 11, 2019, 6:28am UTC](https://forum.babylonjs.com/t/material-texture-with-color-value-no-effect/3797/12 "2019-06-11T06:28:15Z")

</div>

Maybe @bghgary has the rule for this one ???

---

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [June 11, 2019, 12:32pm UTC](https://forum.babylonjs.com/t/material-texture-with-color-value-no-effect/3797/13 "2019-06-11T12:32:27Z")

</div>

Yo @sebavan

I just end up writing a **HasNonBlackColors(Color[] colors)** function to test the mesh vertex colors… If they are **ALL BLACK** mean not one R G B channel is \> 0.0… Then i ignore all black mesh vertex colors and **NOT** encode GLTF mesh.colors.

Working so far… I figure if you want the mesh to have some kind a **COLORING** then **AT LEAST ONE** pixel should not be **ALL BLACK**

Thanks for pointing that out to me… That is the **second** time those vertex colors screwed me up … the first was some vertex colors had ZERO ALPHA…

By the way… how did you tel all the vertex colors was black ???

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [June 11, 2019, 12:34pm UTC](https://forum.babylonjs.com/t/material-texture-with-color-value-no-effect/3797/14 "2019-06-11T12:34:18Z")

</div>

I checked in the inspector and as the map was correct and the surface black, I checked with spector, and figured VERTEXCOLOR was on try to disabled it and it worked 🙂

---

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [June 11, 2019, 12:36pm UTC](https://forum.babylonjs.com/t/material-texture-with-color-value-no-effect/3797/15 "2019-06-11T12:36:03Z")

</div>

Kool … Thanks again 🙂

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [June 11, 2019, 2:26pm UTC](https://forum.babylonjs.com/t/material-texture-with-color-value-no-effect/3797/16 "2019-06-11T14:26:31Z")

</div>

I’ve ran into this before. IIRC, vertex colors are ignored in Unity when using Unity’s standard materials.
