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
0
votes
1 answer

3d normal map not working correctly in Three.js

I want to add a normal map to my mesh and when I applyed to it the model becoms rendered as flat not smooth and I don't get the effect I want. Here is my material code: var material = new THREE.MeshPhongMaterial( { map:…
Milos Miskone Sretin
  • 1,748
  • 2
  • 25
  • 46
0
votes
2 answers

Specular highlights depend on camera distance

I just tried implementing specular highlights. The issue is that when moving far away from the surface, the highlight becomes stronger and stronger and the edge of the highlight becomes very harsh. When moving too near to the surface, the highlight…
danijar
  • 32,406
  • 45
  • 166
  • 297
0
votes
0 answers

Does specular light takes point or direction?

Does specular ligh takes a point or direction as light? If direction, theb should it be calculated such as LightPosition - VertexPosition ? Or just as manualy specified LightDirection ?
tvoloshyn
  • 407
  • 8
  • 22
0
votes
1 answer

Specular Light appears on both sides

I have a very strange behaviour of specular(phong light model) light. It seems to be appering on both sides of all objects. Does anyone know what could be the issue ? The actual calculation seems to be alright, as I can see that the light changes…
tvoloshyn
  • 407
  • 8
  • 22
0
votes
1 answer

Texture mapping with phong lighting

Im trying to add Phong lighting to my scene in which I have loaded mesh with textures. This is my mesh loadin class: #define INVALID_OGL_VALUE 0xFFFFFFFF #define INVALID_MATERIAL 0xFFFFFFFF #define SAFE_DELETE(p) if (p) { delete p; p = NULL;…
mezo
  • 423
  • 1
  • 7
  • 19
0
votes
1 answer

Crash when I try to render a triangle mesh (c++)

I'm trying to render a triangle mesh with Phong shading using GLSL, here is my method to assign normals. void renderWireframe(Mesh *mesh) { glDepthMask(GL_TRUE); glBegin(GL_TRIANGLES); for(int i=0; int; i++) { //nv is the mesh's…
0
votes
1 answer

Problems with flat and phong shading

(Edit): The original code I posted was for both gouraud and phong shading options. I've changed it so it is just phong shading and posted below. The mesh is too big to describe here, as it is generated from a Bezier Patch. I'm having some problems…
0
votes
2 answers

Phong Shading vs Tessellation

I ran across Phong Shading while looking at the Source Engine. The desription sounds very much like Tessellation. But when I looked it up, I didn't really find anything directly comparing the two. Now in DirectX Tessellation isn't used like Phong…
0
votes
1 answer

Composing the ADS (Phong/Gourang) components

I have the basic shader code below for the Phong lighting model. I've testing the diffuse, ambient and specular lighting and they're producing the correct results. When it comes to composing them on the final line I keep getting an effect that looks…
user2211776
  • 239
  • 1
  • 2
  • 11
0
votes
1 answer

own implementation of phong illumination with ray casting

I am trying to write a program in java from scratch that renders a sphere with ray casting technique and phong illumination, but I am a bit lost. I understand the concept behind the phong equation coefficients, but I don't understand how to get to…
asdt11
  • 203
  • 1
  • 3
  • 4
-1
votes
1 answer

OpenGL: Problem With Phong Model Specular Lighting

I know that specular lighting is also based on the view direction. But I can't find what the default view direction is in old OpenGL function glLight(.. GL_SPECULAR..). How does it determine the direction of the view?
user14205063
1 2 3 4 5 6
7