Questions tagged [opengl-es-lighting]
18 questions
10
votes
1 answer
Passing own struct into opengl es 2.0 shader
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;…

tyuip
- 157
- 2
- 10
4
votes
1 answer
Why does my GLSL shader lighting move around the scene with the objects it's shining on?
I'm following a tutorial on OpenGL ES 2.0 and combining it with a tutorial on GLSL lighting that I found, using a handy Utah teapot from developer.apple.com.
After a lot of fiddling and experimentation I have the teapot drawn moderately correctly on…

Piku
- 3,526
- 6
- 35
- 38
4
votes
2 answers
Diffuse shader for OpenGL ES 2.0: Light changes with camera movement (Vuforia on Android)
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…

peedee
- 3,257
- 3
- 24
- 42
3
votes
1 answer
Passing an array of structs into OpenGL ES 2.0 shader
I want to implement some kind of lighting. And i'm making a struct, that contains light sourse properties in vertex shader:
struct Light
{
vec4 color;
vec4 pos;
...
};
In my app i want to have several light sources. So i put:
uniform…

Andrew
- 24,218
- 13
- 61
- 90
2
votes
2 answers
OpenGL ES 1.1 strange lighting problems
I am examining an interesting problem I'm facing with OpenGL lighting on Android. I'm working on a 3D Viewer where you can add and manipulate 3D objects. You can also set a light with different attributes. The problem I was facing with my Viewer was…

Chnoch
- 772
- 9
- 20
2
votes
1 answer
GLSL ES Clip Vertex To Far Plane
Im toying with shadow volume on my iPhone and everything work at the exception if the shadow volume cap is clip by the far plane.
Since gl_ClipVertex is not available in GLSL ES, how can I clip the gl_Position.z to be at the far plane? I already try…

McBob
- 1,011
- 2
- 13
- 25
2
votes
1 answer
Street light and shadow in opengl?
To make a scene street illuminated, I tried point source light, used glMaterial and used ambient light.
I get a scene fully illuminated, not exactly the way like street light, can anyone share resources or explain how exactly I can achieve this?
I…

Abhilash Muthuraj
- 2,008
- 9
- 34
- 48
2
votes
2 answers
OpenGL ES Light Question
I am new to OpenGL ES and are developing in Objective-C for iPhone.
What I am trying to understand is how light is positioned in my frustum. This is how I do it:
I create a square and put it as "floor" in my frustum. I am putting the light, right…

Nicsoft
- 3,644
- 9
- 41
- 70
2
votes
2 answers
What is DOT3 lighting?
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.

Rob Jones
- 4,925
- 3
- 32
- 39
2
votes
0 answers
OpenGL ES light specular rendering only on half of object
I am following the book Pro OpenGL ES for Android and am trying to get the specular to render correctly. Here's what is happening:
I am using the OpenTK's ES11.GL.
This is my lighting code:
float[] pos = { -14.0F, 7.0F, -50.0F, 1.0F };
float[]…

Matthew
- 4,832
- 2
- 29
- 55
1
vote
1 answer
is it possible to use OpenGL lighting without declaring surface normals?
is it possible to declare lighting on objects without declaring surfaces normals?
steps i'm willing to do are:
1. enable lighting
2. define surface material
3. define lighting position
4. define lighting parms : ambient....
is it enough or do…

igal k
- 1,883
- 2
- 28
- 57
1
vote
2 answers
Cook-Torrance shader with more than one point light
I am trying to implement the Cook-Torrance lighting mode with four point lights. While I am getting nice results by using just only one point light, I can't understand which is the correct way to sum up the specular term inside my light loop.
I am…

deblocker
- 7,629
- 2
- 24
- 59
0
votes
0 answers
shader and cook-torrance cannot output texture
I am completely new to opengl es shader and cook-torrance,
the following shader only output red, no texture color processed for ambient light and point light.
the cube is for testing,no shader applied to it, the right side rocket with texture with…

Ki ki Ki
- 27
- 3
0
votes
1 answer
OpenGL ES (Android) Cube disabling lighting when glEnable(GL_COLOR_MATERIAL) is added?
This is probably a really simple question, and I'm just not getting it. I'd like to have lighting on a cube, but have some faces have different colors. The following code results in a cube with no lighting, but one black face:
private float[]…

AnimatedRNG
- 1,859
- 3
- 26
- 39
0
votes
2 answers
Phong Lighting in Vertex Shader
I'm trying to use OpenGL ES 2.0 for Android to display a simple cube with normals and colors. To do so, I create a shader program, attach my vertex and fragment shaders, and link my program, as follows:
// Create empty OpenGL ES Program
mProgram =…

Luke
- 2,187
- 1
- 18
- 29