Sign in to follow this  

Material Color

Recommended Posts

Hi all,

I want to ask about StandartMaterial, if I add to material a ambientColor or a diffuseColor or a specularColor it means that this colors mix with material.texture colors in every frame, or just at once and then new colors saves somewhere in buffer.

Need to know this for performance, if all colors mixes every frame I think this bad for performance and I will be find some other ways.

Thanks : )

Share this post

Link to post
Share on other sites

hi @negrant

all material in webgl is a shader and shader have 2 part vertex shader and fragment shader

in each frame vertex shader run for all vertex in the mesh ( if mesh linked to material ) and fragment shader  run per any pixel mesh looked in resolation

so that color mix by texture in all pixel 

all happen in GPU and GPU designed for do that it is optimized  too 


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.