smatt

Flat Shaded not working with pointLight

Recommended Posts

Hello,

I'm currently working with flat shaded meshes and point lights in my Babylon.JS scene and the light is reflecting in a not-flat-shaded way.

Playground demo: http://babylonjs-playground.com/#BRSMM#0
My own screenshot: http://prnt.sc/bx9h3o

My target is to have one "flat color" per face and no light beam reflections which fade over distance.
Is my target even possible with point lights or do I have to use other lights like the hemispheric light?

Thanks for every answer, Simon

Share this post


Link to post
Share on other sites

It has something to do with the specular channel of the light i think


give it a try 
light.specular = new BABYLON.Color3(0,0.0,0.0)


https://doc.babylonjs.com/tutorials/Lights


yeah im just playing aroung, nothing to do with the question
lasers
http://babylonjs-playground.com/#BRSMM#3

with music

http://babylonjs-playground.com/#BRSMM#7

Share this post


Link to post
Share on other sites

Hey!

So, flat shaded meshes simply have their normals calculated differently. As the normals of a ground are always pointing up, you won't see the effect. Here is a flat shaded sphere - http://babylonjs-playground.com/#BRSMM#2

You can achieve what you are trying to do with multi-materials - http://doc.babylonjs.com/tutorials/CreateBox_Per_Face_Textures_And_Colors

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

  • Recently Browsing   0 members

    No registered users viewing this page.