Questions tagged [specular]
44 questions
1
vote
0 answers
Handling undefined, NaN or Inf Values in glsl. Thinking of matherrors
I still didn't get rid of some annoying bugs in my glsl shader (GL 2.0)... I searched for a solution of this problem for over 3 weeks now, but I didn't get any. There are many examples and explanations on google, but none of them really works.
First…

TheWhiteLlama
- 1,276
- 1
- 18
- 31
1
vote
1 answer
How to get specular color in OpenGL?
My code works for everything except specular component.
glEnable(GL_COLOR_SUM);
...
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(4, GL_UNSIGNED_BYTE, 0, color);
glEnableClientState(GL_SECONDARY_COLOR_ARRAY);
glSecondaryColorPointer(3,…

Mike Weir
- 3,094
- 1
- 30
- 46
1
vote
1 answer
GLSL/OpenGL 2.1: Specular Lighting using Uniforms
So, I've begun a quest to implement awesome lighting without using OpenGL's lighting system. I've successfully implemented Phong diffuse lighting. Specular is giving me trouble.
I need to know what spaces the OpenGL constants I'm using occupy,…

Miles
- 1,858
- 1
- 21
- 34
1
vote
0 answers
Webgl - How to make Specular Light not change size
I am trying to implement specular lighting (thats coming from the front) but the light is always changing size in an unnatural way. How do I fix this?
I hardcoded viewerPos to test. I'm using a halfway vector "shortcut" so I have to calculate less…

Andrejcc
- 134
- 8
1
vote
1 answer
OpenGL ES 2.0 Specular light generates black border
I've been working on light mechanics for an app and got the diffuse light (ambient and directional) working just fine, but the specular light creates some weird effects. As if it nullifies the diffuse light in a strip around it.
Here is the specular…

WarSensation
- 84
- 2
- 11
1
vote
1 answer
Why does my shader produce incorrect specular results? [DX11]
I am currently attempting to implement Phong shading & lighting on a textured cube using HLSL and DirectX 11. I believe my ambient and diffuse lighting calculations to be correct and visually they produce an expected result. However when I apply…

Stephen Moore
- 13
- 3
1
vote
1 answer
Specular Lighting breaks at origin (0, 0, 0)
im having problem to get specular lighting to work. It looks like im having some kind of bug in my application which im not able to trace.
Light is coming from the front (screenshots shows camera looking at -z direction, on the left is -x).
A simple…

Raphael Mayer
- 667
- 6
- 19
1
vote
1 answer
Not so smooth shading
Blinn-phong shading...?
So the issue I'm having, as the above image hopefully illustrates, is that I can't seem to get my specular highlights to shade smoothly. The problem is the abrupt cutoff along face edges, which shouldn't be happening. The…

Fault
- 420
- 3
- 17
1
vote
0 answers
Specular highlights of a translucent object - OpenGL
I am working on my final project for my Computer Graphics course. It is all done in OpenGL. My project is to create a simulation of bubbles underwater. It is not supposed to be realistic, however, I have done all the requirements from my project…

user3022834
- 11
- 1
0
votes
1 answer
Sceneform, Pale 3D model
I'm noticing with Sceneform 1.16.0 that sometimes my 3D model (glb) loads and appears pale/lighter (right screenshot), like there's a layer over top of it. Any idea why this could be? This occurs approximately every 35 loads.
…

VIN
- 6,385
- 7
- 38
- 77
0
votes
1 answer
Glsl multi sample blending for specular lighting
How can i blend diffuse texture with specular, which gL Blend function i should use and when.
My specular lighting is based on special texture which has transparency.
For now im just changing pixel brightness relative to alpha value and combine…

user9868797
- 1
- 2
0
votes
0 answers
pixel shader behaves strange when using variable
MY problem is that when I calculate and add specular light from a point light, then it's fine if I hardcode in a number in the pixel shader, but if that number comes from a variable (it's the exponent), then the result is blocky, very sharp contrast…

Emil Johansson
- 1
- 3
0
votes
0 answers
How to add specular lightning and reflected colors to object color in ray tracing?
I've been trying to code a very simple ray tracer in Java as a beginner learning experience. So far, I can render ambient and Lambertian shading and I've been trying to add specular highlights and reflections with no success.
Every website I've…

symbolads
- 43
- 6
0
votes
1 answer
Blender 2.8 to ThreeJS GLTF Specular
I have a model in Blender 2.8 ( and 2.79 ) with a grass texture on a plane. It's a field. No matter what I set the metalness and roughness to, when viewing it in ThreeJS there's always a whitish sheen on the field when looking at it from certain…

M1ke
- 239
- 2
- 11
0
votes
0 answers
Specular highlight moves as camera moves
I am implementing a specular highlight in OpenGL as part of the phong model. Currently, the highlight moves when my camera moves rather that getting brighter or dimmer which obviously isn't the expected result. I have followed the tutorial on…

Callum Perks
- 71
- 5