Jump to content

Model tint with transparency


royibernthal
 Share

Recommended Posts

I'd like to tint a model to black with a certain amount of transparency, let's say 60%, in a way that you'll be able to see the model's texture beneath the black tint, at 40% clarity.

I created a material with black diffuse color, and applied it to the model's meshes. It is pitch black though, is there a way to make it only 60% tinted?

http://www.babylonjs-playground.com/#1SVN3I#57

Link to comment
Share on other sites

Not what I had in mind. What you did sets the whole mesh to pitch black and then sets the alpha of the whole thing (still in pitch black), instead of just the alpha of the black "layer" on top of it.

Attached an image that helps explain what I need - left side is 50% black tint, right side is no tint.

tint.png

Link to comment
Share on other sites

Nice hack, the result is what I wanted, but the way is too convoluted, given I'm dealing with multiple models, each having multiple meshes.

Worst case scenario I guess I can have 2 global lights, 1 dimmed and one normal, and constantly include and exclude meshes from them.

 

With that said, surely there is a simpler way to control the percentage of light a mesh reflects back?

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...