Sign in to follow this  
DylanD

Standard Material with Texture diffuseColor

Recommended Posts

Hello everyone,

I have a problem, I have a standard material with a texture, and I want to use diffuseColor to make it look purple, it normally is blue, so I try adding red, but that doesn't seem to do anything.  I found a similar problem in the playground, where I can turn the one ball red but the other ball will not turn blue.  I don't understand why this happens.

http://www.babylonjs-playground.com/#20OAV9#218

is there a way around this?  Is this normal?

Any ideas?

Share this post


Link to post
Share on other sites

It is all expected as the light does not contain any blue, it means all your diffuse blue part will not be visible and the only color resulting from diffuse will be black added to your emissive texture resulting to only the color of the the emissive texture.

The way around it is either to use emissive color so that it is not impacted by the lights or to add some blue in you light diffuse color.

Share this post


Link to post
Share on other sites
15 minutes ago, Sebavan said:

It is all expected as the light does not contain any blue, it means all your diffuse blue part will not be visible and the only color resulting from diffuse will be black added to your emissive texture resulting to only the color of the the emissive texture.

The way around it is either to use emissive color so that it is not impacted by the lights or to add some blue in you light diffuse color.

In my  scene it seems that all of my lights have 1,1,1 so white light which should include blue red and green, but I can't get red to show, also I tried emissive color and it didn't seem to make change the texture at all.

Thank you though, now I know what to look for.

Share this post


Link to post
Share on other sites

Do not hesitate to create a repro closer from your scene in the playground.

Also when using texture + color, it is a multiplication so if the texture has no blue, the result will not be blue even if the color contains blue : "emissive = emissiveColor * emissiveTexture"

Share this post


Link to post
Share on other sites

 

21 minutes ago, Sebavan said:

Do not hesitate to create a repro closer from your scene in the playground.

Also when using texture + color, it is a multiplication so if the texture has no blue, the result will not be blue even if the color contains blue : "emissive = emissiveColor * emissiveTexture"

I would like to make a much more accurate playground but I have a complicated scene and many scripts.

The texture doesn't really have any red in it at all only blue and green, so it won't show red?  Not sure I understood that right. 

So since it is multiplicative theres no way to get any red?

Is there a way I could do it using additive?

Would diffuseColor also work using multiplication?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.