Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Making a simple diffuse lighting shader. (Question, 1.5)

edited February 2013 in Shaders Posts: 12

This post nearly went into Questions, but there is a brand new category here, and it needs attention. I think I won't be the only person reading a lot of what is posted here. 

Is there any example code written to do a diffuse or other lighting shader on a mesh in 1.5?

https://gist.github.com/RichardMN/4973013 is a gist of a LatheMesh class I wrote for 1.4.6, which would "bake on" lighting while creating rotated solids. If you set the useDiffuseShader button to on you will see that I am not yet managing to get a diffuse light shader to play nicely with the normals I think I have put into the mesh. (Please be kind - that is my first gist. I have been using phorkie at home for version control of Codea projects.)

As you can see, the conversion to 1.5 is ony partial so far - enough to make warnings about deprecated parameters go away, but there are still some new bits of 1.5 which could be better used here.

Advice on how to have a non-black shaded object would be welcome...

Cheers,
  Richard

Comments

Sign In or Register to comment.