Sign in to follow this  
Koroldev

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

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.