Questions tagged [phong]

Phong shading is a 3D lighting model and interpolation method used in OpenGL and other 3D APIs.

Phong shading is an interpolation technique.
Phong reflection model s an empirical model of the local illumination of points on a surface.

101 questions
2
votes
1 answer

Using Phong lighting with directional lighting

I wrote a simple demo-program that applies directional lighting to a scene. Right now I'm getting this image: The problem is that I can't figure out how can I set object's material reflection settings (ambient, diffuse, specular, shininess,…
Temax
  • 87
  • 7
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…
2
votes
2 answers

Make light independent from the view in a Phong model

I'm trying to implement the Phong shading model, but I come across something quite strange. When I change the viewing position, it looks like the light behaves differently, as if it was dependent from the view. Like, if I'm close to the object I…
memememe
  • 663
  • 6
  • 21
2
votes
1 answer

Ray tracing: Problems with Shadow Rays Output

Before this is tagged as a duplicate, I am having the exact same problem as the individual who asked this question. Unfortunately, it doesn't have an answer that helped at all, so hopefully this will spark a better discussion. Using C++, the task at…
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

THREE.js: Simulating MeshBasicMaterial while allowing colored lights

I am making a dungeon crawler type game using three.js. I was using MeshBasicMaterial to make everything "truebright" to make the dungeon consistently visible throughout. However, I wanted to add "bonus" lights coming through under doorways or slits…
Kerma
  • 69
  • 1
  • 10
2
votes
1 answer

Blinn-Phong illumination - what is the best calculation of the complete color

Almost all of the articles and books that I've read state that the composition of the final color is: finalColor = ambientColor + lambertianTerm * diffuseColor ( = material color ) + specularIntensity * specularColor ( = light color ) lambertianTerm…
Ivan Caravanio
  • 597
  • 1
  • 7
  • 20
2
votes
1 answer

Is it possible to obtain light intensity information for a surface using Matlab's 'light' function?

In Matlab, we can create a basic surface with flat face lightning using the following: peaks(10) light This creates the following picture: Is there a way to obtain the matrix indicating light intensity on the surface patches for the current view?…
TSGM
  • 263
  • 1
  • 9
2
votes
1 answer

Should the gl_FragColor value be normalized?

I am writing a Phong lighting shader and I have a hard time deciding whether the value I pass to gl_FragColor should be normalized or not. If I use normalized values, the lighting is a bit weird. For example an object far away from a light source…
Cosmin Stamate
  • 145
  • 1
  • 1
  • 11
2
votes
0 answers

Proper use of phong shader in LibGDX

I am trying to use phong shader in LibGDX. If I use default shader of LibGDX, the scene looks like below: But I want to apply light and shadows to the scene and if use phong shader, something goes wrong. The scene flickers and looks very different…
Nolesh
  • 6,848
  • 12
  • 75
  • 112
2
votes
0 answers

Diffuse normal inversed when 3D model too large (cilinder) using ASSIMP and Phong shading

Currently I'm setting up some lighting in a 3D scene I created in Blender and loaded via assimp with the following options set: aiProcess_GenSmoothNormals | aiProcess_Triangulate | aiProcess_CalcTangentSpace | aiProcess_FlipUVs Currently I'm stuck…
Joey Dewd
  • 1,804
  • 3
  • 20
  • 43
2
votes
0 answers

ThreeJS: Does bumpMap for Phong Material uses UV Mapping?

I got crazy trying bumpMap working on a PhongMaterial in ThreeJS (r61). The diffuse and normal are working fine. Here is my code: var params = { map: new THREE.ImageUtils.loadTexture("models/displ/"+configObj.name+"_diffuse.jpg"), bumpMap:…
2
votes
0 answers

GLSL Phong Shading not working

I am trying to use this tutorial for per-fragment shading and adapt it to GLSL #version 140. The results I am getting are obviously not correct. Seems to me that I am doing something wrong with the supplied normals, since there is a direct change…
Vojta Hejda
  • 177
  • 2
  • 14
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

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