Questions tagged [specular]
44 questions
6
votes
1 answer
OpenGL shimmering pixels artifact
I'm trying to implement ambient occlusion on a voxel-based mesh and get these flickering white pixels at the edges of faces:
Here is my fragment shader:
#version 120
varying vec4 color;
varying vec4 normal;
void main(void)
{
float light =…

Reed G. Law
- 3,897
- 1
- 41
- 78
5
votes
1 answer
OpenGL object glossy/shiny in Mac OS X 10.6, but not 10.5. Why?
I've written an OpenGL screensaver for Mac OS X 10.5 and higher which shows a spinning heart constructed using marching cubes. It works fine on my black 13.3" development Macbook running Snow Leopard (10.6), nice and glossy.
But when I try it on a…

thinkski
- 1,306
- 1
- 15
- 25
5
votes
1 answer
How to calculate specular contribution in PBR?
I'm trying to implement physically-based rendering (PBR) in our project (we started a small game engine for academic and learning purposes) and I cannot understand what is the right way to calculate specular and diffuse contribution based on…

TheCrafter
- 1,909
- 2
- 23
- 44
5
votes
2 answers
Specular lighting appears on both eye-facing and rear sides of object
I am writing a small test of Phong shading, and am hitting my head against a brick wall trying to get the specular component working. It appears to work correctly, except that the specular light is applied to both the front & rear of the object.…

ASpence
- 61
- 1
- 6
4
votes
1 answer
Directx9 Specular Mapping
How would I implement loading a texture to be used as a specular map for a piece of geometry and rendering it in Directx9 using C++?
Are there any tutorials or basic examples I can refer to?

Tom J Nowell
- 9,588
- 17
- 63
- 91
3
votes
1 answer
Why is my diffuse/specular lighting not working?
I've got an OpenGL program running, and it displays geometry, but it's all "flat," one gray tone, with no diffuse shading or specular reflection:
Pictured are three tori, each made of quad strips. We should see shading, but we don't. What am I…

LarsH
- 27,481
- 8
- 94
- 152
3
votes
3 answers
Specular lights on cube in opengl es
In some tutorials where the lighting is introduced, people would start with an example of a sphere, lit by all three types of lights: ambient, diffuse and specular. One can then easily see, e.g. by switching off individual lights, that the ambient…

user3211670
- 31
- 1
- 3
3
votes
1 answer
How can I create a specular with a specular map on a custom shader in three js?
I am creating an earth in WebGL using Three.JS, and so far I have an earth with day and night texture and an atmosphere. Now to finish it off, I want to add a specular to my earth that only shows on the water sections. Now, I already have a specular…

Giel Berkers
- 2,852
- 3
- 39
- 58
2
votes
1 answer
How to make specular lighting on python to implement the Phong lighting?
I need your help. Using python, I have to implement the lighting of my three-dimensional shape by the phong model. My figure is a deltoidal icositetrahedron. I was able to build this shape, found the coordinates of the vertices, and also calculated…

YURIY USYNIN
- 21
- 2
2
votes
1 answer
Understanding Oren-Nayar reflectance model
In the Oren–Nayar reflectance model, each facet is assumed to be Lambertian in reflectance. wiki
My understanding :
Law of reflection tells us that angle of incidence is equal to angle of reflection. So on a perfectly smooth surface, we get…

midi
- 460
- 3
- 17
2
votes
2 answers
Phong lighting: add specular lighting separately or with ambient and diffuse?
I am trying to implement Phong lighting. In some tutorials specular lighting is added to ambient and diffuse lighting and then total lighting is multiplied by texture color. I also saw a tutorial where specular lighting was added separately after…

Saik
- 993
- 1
- 16
- 40
2
votes
1 answer
Strange specular results from GLSL phong shader
I'm trying to implement phong shading in GLSL but am having some issues with the specular component.
The green light is the specular component. The light (a point light) travels in a circle above the plane. The specular highlight always points…

StackAttack
- 57
- 1
- 6
2
votes
1 answer
exporting Bump and Specular maps
I have seen the new MeshPhongMaterial Bump and Specular highlights, and can't wait to get them into my game engine.
Currently i am using the python converter to convert an OBJ file into a .js file. However release 51 exporter doesn't seem to handle…

RenegadeMaster88
- 41
- 5
2
votes
1 answer
Matlab calculate reflection of Vector
I have to calculate the Specular Highlights (phong) of an Image. the normal Vector and the "light vector" are given. Now I have to calculate the light reflection - is there an efficient matlab function to flip the light Vector over the normal vector…

NaN
- 3,501
- 8
- 44
- 77
1
vote
1 answer
Phong-specular lighting in glsl (lwjgl)
I'm currently trying to make specular lighting on an sphere using glsl and using Phong-model.
This is how my fragment shader looks like:
#version 120
uniform vec4 color;
uniform vec3 sunPosition;
uniform mat4 normalMatrix;
uniform mat4…

Wirde
- 400
- 3
- 14