I am looking to achieve a similar effect as the undulating sphere demonstrated in the Aerotwist Tutorial. Instead of using a fake GLSL hard-coded light like in the tutorial, I am interested in passing information from a three.js PointLight instance to my shaders, manipulating vertices and normals, and then implementing Phong shading.
My understanding of the GPU considerations when shading a scene in three.js is as follows (specifically with Phong):
- No GPU consideration: Utilize a MeshPhongMaterial without custom shaders for simplicity.
- Some GPU consideration: Use a pre-written ShaderLib Phong shader for additional control on the GPU side without custom modifications.
- Full GPU management: Employ a ShaderMesh and write custom shaders for complete customization by explicitly defining attributes and uniforms.
Q1: Is my understanding accurate?
Q2: Is there an intermediate option between levels 2 and 3 that allows for customizing shaders without creating them from scratch?
Q3: If not, what is the best approach to achieving full customization with level 3? Should I pass light properties as uniforms, modify vertex/normals, and then implement explicit Phong shading calculations?