Jump to content

Flat Shaded not working with pointLight


smatt
 Share

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

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

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

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