opengl-es-lighting

Diffuse shader for OpenGL ES 2.0: Light changes with camera movement (Vuforia on Android)

烂漫一生 提交于 2019-12-10 16:03:25
问题 As a starting point I use the Vuforia (version 4) sample called MultiTargets which tracks a 3d physical "cube" in the camera feed and augments it with yellow grid lines along the cube edges. What I want to achieve is remove the textures and use diffuse lighting on the cube faces instead, by setting my own light position. I want to do this on native Android and I do NOT want to use Unity. It's been a hard journey of several days of work and learning. This is my first time working with OpenGL

Passing own struct into opengl es 2.0 shader

跟風遠走 提交于 2019-12-05 17:26:19
问题 I want to try a lighting example from the book OpenGL ES 2.0 Programming Guide. In the shader they have made two structures. struct directional_light { vec3 direction; // normalized light direction in eye space vec3 halfplane; // normalized half-plane vector vec4 ambient_color; vec4 diffuse_color; vec4 specular_color; }; struct material_properties { vec4 ambient_color; vec4 diffuse_color; vec4 specular_color; float specular_exponent; }; They have also made two uniforms, based on these

Passing own struct into opengl es 2.0 shader

不羁的心 提交于 2019-12-04 01:58:56
I want to try a lighting example from the book OpenGL ES 2.0 Programming Guide. In the shader they have made two structures. struct directional_light { vec3 direction; // normalized light direction in eye space vec3 halfplane; // normalized half-plane vector vec4 ambient_color; vec4 diffuse_color; vec4 specular_color; }; struct material_properties { vec4 ambient_color; vec4 diffuse_color; vec4 specular_color; float specular_exponent; }; They have also made two uniforms, based on these structures. uniform material_properties u_material_properties; uniform directional_light u_directional_light;

What is DOT3 lighting?

杀马特。学长 韩版系。学妹 提交于 2019-12-02 02:01:32
问题 An answer to my question suggests that DOT3 lighting can help with OpenGL ES rendering, but I'm having trouble finding a decent definition of what DOT3 lighting is. Edit 1 iPhone related information is greatly appreciated. 回答1: DOT3-lighting is often referred to as per-pixel lighting. With vertex lighting the lighting is calculated at every vertex and the resulting lighting is interpolated over the triangle. In per-pixel lighting, as the name implies, the object is to calculate the lighting

What is DOT3 lighting?

最后都变了- 提交于 2019-12-02 00:50:11
An answer to my question suggests that DOT3 lighting can help with OpenGL ES rendering, but I'm having trouble finding a decent definition of what DOT3 lighting is. Edit 1 iPhone related information is greatly appreciated. DOT3-lighting is often referred to as per-pixel lighting. With vertex lighting the lighting is calculated at every vertex and the resulting lighting is interpolated over the triangle. In per-pixel lighting, as the name implies, the object is to calculate the lighting at every pixel. The way this is done on fixed function hardware as the iPhone is with so called register