Jump to content

Standard Material with Texture diffuseColor


DylanD
 Share

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?

Link to comment
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.

Link to comment
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.

Link to comment
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"

Link to comment
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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...