Howdy, Stranger!

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

Phong Lighting Shader Code

Hey, all!
It's been some time since I've really been on the forums and in that time, I've been learning how to make my own Phong lighting. Below is a gist to the project code:
https://gist.github.com/Kolosso7/a9687ed6fa017f5f028d3e3d900ab484

Description

The code includes a 3D scene lit by a Phong lighting shader with 1 point light, and several functions that can be useful for adding vertices, normals and texture coordinates to meshes; such functions include: addCube, addEllipse & addCylinder. Change the variable useShader to false to compare the difference that the shader makes. All of the code is available for anyone to use in their own projects. Enjoy!

Photos

Photos are attached.

image.jpeg 45.8K
image.jpeg 47.6K

Comments

  • SimeonSimeon Admin Mod
    Posts: 5,024

    Very nice! How satisfying is it to write lighting shaders from scratch

  • Posts: 160

    It's very satisfying. You learn a lot from it. Here's my advice to anyone who understands 3D but wants Craft to do all the work: It may be easier to use Craft, but you learn a lot from making your own lighting. Start easy and use Ignatz's ebook. Ignatz makes it really easy to understand.

Sign In or Register to comment.