103 questions
1
vote
0
answers
52
views
How to replicate Phong shading with a high specular highlight in WebGL using Three.js?
I'm trying to render two spheres in Three.js with custom Phong shading using GLSL shaders. I want the right sphere to have a high specular highlight, similar to the one in this reference image, where ...
0
votes
1
answer
71
views
Drake geometry added using MultiBodyPlant is too shiny
I've added a "table" to my scene using Drake's MultiBodyPlant.
plant.RegisterVisualGeometry(
plant.world_body(), RigidTransform(p=table_position),
table, "TableVisualGeometry&...
1
vote
1
answer
99
views
Specular lighting in LWJGL 3 not working [Phong Shading]
I implemented lighting in my engine. But there is some problem the object does not lights up properly
The specular lighting does not work at all
Here is the vertex shader :
#version 330
layout (...
1
vote
1
answer
509
views
Why light color in PBR material can be larger than 1?
Recently, I implemented the PBR lighting following the LearnOpenGL tutorial. But I found that the light color the tutorial use is very large (e.g. 20~300, https://learnopengl.com/PBR/Lighting), which ...
1
vote
0
answers
195
views
Somthing wrong with my python implementation of phong shading with only numpy and PIL
Recently, I tried to implement Phong shading with only NumPy and PIL using python. But there is some black-and-white noise in the rendered image. Can you point out what I should do to improve my code ...
2
votes
1
answer
665
views
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 ...
0
votes
1
answer
173
views
Got weird lighting result based on Phong model after learning LearnOpenGL chapter 13
First incorrect result
Hello guys, I've been studying OpenGL on learnopengl.com and I found the result weird when I finished learning the basic lighting chapter. The result is I found specular light ...
0
votes
0
answers
150
views
ThreeJS: Use a ShaderMaterial as an alphaMap inside a MeshPhongMaterial
Let's say we have a black and white Shader on a sphere.
Is it possible to use it as an alphaMap on a MeshPhongMaterial for another sphere?
Can we use a ShaderMaterial as an alphaMap of a ...
0
votes
1
answer
694
views
Three js object turning black when applying Phong Shading
I have a project that basically displays 3 cubes and if i press A i alternate the material of the cubes between a MeshLambertMaterial and a MeshPhongMaterial. The problem is whenever i create the ...
0
votes
1
answer
736
views
ThreeJS Phong material is coming dark
I am loading a BM3 file which contains definitions of (geometry and) material information as below:
{
type: "Phong",
opacity: 1,
name: "",
diffuseMap: 0,
color: [
0....
1
vote
0
answers
959
views
OpenGL - How to properly add lighting to a scene using the Blinn-Phong shading model?
Recently, I have been trying to add lighting to a simple OpenGL scene using the Blinn-Phong shading model as described in this website.
I tried to follow the tutorial as closely as possible. However, ...
0
votes
1
answer
368
views
Strange ring around specularity when shading according to Phong model
I am writing a raytracer and shading using the Phong illumination model. In this example, my material does not have any ambient term. When I render, I get the following image:
As you can see, there ...
0
votes
1
answer
607
views
Can the Phong shading model be implemented in fixed function pipeline OpenGL? [duplicate]
The Phong shading technique interpolates normals at vertices to achieve a smooth shading effect. It is usually combined with the Phong illumination model, and it can be implemented in modern OpenGL. ...
1
vote
1
answer
3k
views
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 ...
-1
votes
1
answer
108
views
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 ...
6
votes
1
answer
15k
views
What is the difference between Phong Shading and Gouraud Shading?
As I understand it, Gouraud shading calculates light color for each vertex and does interpolation on that color, whereas Phong shading interpolates the normal for each pixel and calculates light color ...
1
vote
0
answers
567
views
Refraction in ray tracer produces odd results, how do I combine all color components?
I am writing a ray tracer, so far with only spheres, in C++ and after implementing Phong's reflection model, shadows and reflections, everything seemed to work fine. When I implemented refractions and ...
0
votes
1
answer
1k
views
OpenGL: Lighting without shaders [closed]
How can I make phong lighting without using a shader (university task).
Can I manually calculate ambient, diffuse, specular and transfer their sum to glColor?
UPD:
I have a good display of the sum ...
1
vote
0
answers
491
views
opengl point-light phong specular reflection problem
Point light specular reflections in phong shading displayed incorrectly, assume some shader issues?
Specular highlights displayed rotated and skewed to the center of the render target
Done it before ...
4
votes
1
answer
2k
views
OpenGL Phong lighting: specular highlight is wrong
There seems to be an odd problem with my Phong lighting shader in OpenGL. The specular highlight appears on the wrong side of the object.
The problem at hand:
As you can see, the specular highlight ...
1
vote
0
answers
166
views
JavaFX: How to make a transparent glowing material?
I want to create a PhongMaterial with a uniform glow. The effect is, I have a small Earth model and I would like to surround it with a cheap imitation of the aurora. https://i1.wp.com/trendintech.com/...
1
vote
1
answer
651
views
RayTracing, Phong model/specular lighting not working?
I've been trying to produce a glossy shading using the Phong model but for some reason instead of glossy appearance, all I get is big white blotch on the front of the sphere. Initially the model ...
7
votes
3
answers
863
views
Bad lighting using Phong Method
I'm trying to make a cube, which is irregularly triangulated, but virtually coplanar, shade correctly.
Here is the current result I have:
With wireframe:
Normals calculated in my program:
Normals ...
6
votes
1
answer
315
views
Concentration of potentially active microfacets in a Normal Distribution Function
I'm trying to understand the Cook-Torrance Microfacet Model and am currently stuck on the Normal Distribution function D (being either Beckmann, Blinn-Phong or GGX).
Several online resources claim ...
1
vote
0
answers
889
views
Ray tracing using the Phong illumination model: bizarre color in lighting seemingly fixed by reducing light intensity?
I'm writing a simple ray-tracer with lighting using Phong illumination model. But the problem is that there's part of the sphere display a whole different color. For example, the sphere should be only ...
2
votes
2
answers
690
views
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 ...
1
vote
0
answers
4k
views
PBR textures and the Phong Shading model material parameters
I'm studying the Phong shading model and it looks like materials have these properties:
Ambient, diffuse and specular coefficients (which show how they react to those properties of a light)
Shininess ...
0
votes
0
answers
260
views
Transforming lights in glsl vertex shader with additional uniform mat4?
I'm using a scene graph for my scene. It contains lights and meshes. Meshes have local transforms, and if a node is the child of a mesh node, its own local transform gets composed with the transform ...
3
votes
2
answers
907
views
Artifacts with phong shading and ray-tracing
I am currently experimenting different artifacts when implementing phong shading on my ray-tracer.
The first case case happens when I implement the specular lighting calculation the way I suppose to ...
0
votes
2
answers
1k
views
Why won't my normals interpolate between the vertices, thus creating a flat shading effect?
I am having some trouble with my Phong shading algorithm. It seems like the normals are off and I always get a flat shaded surface.
I am implementing deferred rendering, so in my geometry pass I ...
0
votes
0
answers
66
views
Doubts about Phong shading WebGL formulas as explained in Angel Shreiner book
In the 8th pack of slides of the Angel Shreiner book "Interactive Computer Graphics" (slides available here) the suggested code for calculating lighting starts like this:
vec3 pos = -(...
0
votes
1
answer
882
views
"Specular" color with phong shading and raytracing overflows
I implemented phong shading on my raytracer. Unfortunatelly I am receiving a segmentation fault when running it. The likely cause is related to the "specular_color" Vec3f variable (with is an object ...
0
votes
0
answers
260
views
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 ...
3
votes
1
answer
2k
views
blinn-phong shading with numpy
I am trying to implement blinn-phong shading in numpy for educational purposes. However I am stuck at debugging what parameters are doing for several days now.
My general idea was the following. ...
0
votes
1
answer
563
views
How to pick light source for Phong shading implementation?
I am trying to implement the Phong shading model and I am unsure of how to pick a light source. More specifically, I do not understand what the light source should look like. Should it be a vec3? Or ...
3
votes
1
answer
1k
views
ThreeJS shaders in Unity
I'm working on a project in Unity that uses AR to place products in the real world. These products (geometry & material) are downloaded from a http server and converted into a gameobject in Unity. ...
0
votes
1
answer
491
views
Raytracing / Phong Model Diffuse component
I'm having trouble with the Phong Model specifically the diffuse component and using the right normal vector and direction to light vector. The best I do was get half of the larger sphere to shade but ...
2
votes
1
answer
1k
views
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 ...
1
vote
1
answer
654
views
Phong Shader: Fixed light specular component rotates with camera
I wrote a Phong shader for WebGL. My Scene supports camera rotation using Euler Angles. The light should be fixed in the scene. As soon as I rotate the camera the specular effects on objects move as ...
4
votes
0
answers
938
views
OpenGL gamma correction with GL_FRAMEBUFFER_SRGB
I am writing a Blinn Phong (LearnOpenGL tutorial) lighting and trying to get gamma corrected colors as final result.
Before i start digging about gamma correction, my lighting looks like this:
Then i ...
2
votes
1
answer
2k
views
Phong Lighting is occasionally too bright on some parts of my terrain (OpenGL)
Using Triangle_Strips and heightmaps I made a mountainous terrain, and used 3D planar projection for texturing. For 3D planar projection, I followed section 1.5 of the following link.
https://...
1
vote
1
answer
181
views
Phong shader didn't work
I would like to render by using phong shading. I use OpenGl ES 3.0 and I implemented gouraud shading and it worked. But when I render objects by using phong shading, it didn't work. I think there are ...
4
votes
0
answers
245
views
Box Scaling in JavaFX 3D improperly reflects light
My goal is to reproduce a gif in JavaFX.
Everything is great, except for when changing so many box heights at once, it slows the machine down.
I have decided to remedy this by scaling by the y axis ...
0
votes
0
answers
247
views
OpenGL Phong Shading
I'd like to render object to see the inside of the box.
I used Phong Shading.
When I draw object with glPolygonMode(GL_FRONT_AND_BACK, GL_LINE), an image looks like this:
But When I used ...
0
votes
1
answer
634
views
Combine material coefficients and textures in Phong Shading
I'm trying to implement a simple Phong shader that supports non-physically-based materials and textures. Even though the material has a texture for each light component I still want the respective ...
1
vote
0
answers
75
views
threejs: Does anyone know what happened to phong/standard shading support on recent (Nougat) smartphone releases of Android?
i.e., MeshPhongMaterial, MeshStandardMaterial. These materials now render as black.
Examples:
https://threejs.org/examples/#webgl_animation_skinning_blending
https://threejs.org/examples/#...
2
votes
2
answers
2k
views
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 ...
0
votes
0
answers
127
views
Phong lightning model illuminate corners
I am trying to implement the phong lightning model in this cpp framework.
The Diffusion works fine but the specular seems to lightning the sphere corners...im not really sure why, because the ...
0
votes
1
answer
812
views
Change values of Phong Shader with sliders
I am trying to implement a 3D scene with WebGL and Javascript. The final scene is supposed to show a cuboid with smaller cuboids, pyramids and spheres on all sides. The smaller spheres have to rotate ...
3
votes
1
answer
3k
views
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 "...