Questions tagged [shading]
The shading tag has no usage guidance.
74
questions
1
vote
1
answer
45
views
Shading normal and geometric normal for refractive surface rendering
I got confused when implementing my own renderer. I read this from the PBR-book:
Fortunately, there is an elegant solution to these problems. When evaluating the BSDF, we can use the geometric normal ...
2
votes
0
answers
44
views
Optimal Command Ordering for CPU/GPU concurrency
I am writing a renderer that uses a deferred clustered shading technique.
On the CPU I group lights, decals, and environment maps into 3 seperate clustered structures (functionally, arrays of unsigned ...
0
votes
1
answer
94
views
How can I transform the circular blinn-phong specular into a square shaped highlight?
I am creating a custom shading model in Unreal Engine and I would like to create a square shaped specular highlight, without changing the shape of the light itself.
I tried following the approach ...
2
votes
1
answer
39
views
What does "rendering a surface shaded with vertex positions" mean?
I am a newbie in Computer graphics and trying to implement Dynamic Fusion following the paper. I can understand most of the paper, but there is this line bothering me "rendering the warped ...
1
vote
2
answers
192
views
Applying Phong illumination to a colored surface
The formula for Phong illumination as given on Wikipedia (see there for the variable definitions) is:
$$I_\text{p} = k_\text{a} i_\text{a} + \sum_{m\;\in\;\text{lights}} (k_\text{d} (\hat{L}_m \cdot \...
0
votes
0
answers
82
views
Ray tracing of a diffuse material sphere doesn't work, the sphere just shades black
I made this ray tracer in javascript to run on html with imageData. I have been using the book "Ray Tracing in One Weekend" as a reference (https://raytracing.github.io/books/...
0
votes
1
answer
151
views
OpenGL old-style diffuse shading producing unexpected effects
Question:
What is going wrong with the shape of the contours of constant illumination in the below picture ?
Detail:
Although Lambertian shading might be ill-regarded because it exposes the hard edges ...
1
vote
1
answer
167
views
Specular reflection with different viewing direction where reflection direction and viewing direction coincide
Suppose $P_1$ and $P_2$ two different points on surface. And let
$l$: be the light source direction,
$n$: normal vector
$r$: specular reflection direction
$v$: viewing direction .
In case 1 (at $P_1$...
1
vote
2
answers
175
views
Is it possible to change pixel brightness programmatically?
So, I've been learning 3D rendering for more than a year now, and I've read a lot about various rendering techniques and theories, such as PBR, deferred shading, real-time raytracing, BRDF, all that ...
1
vote
1
answer
77
views
Help understanding tangent from dot product and max distance from component wise vector multiplication
I am looking through this code and seeing two things which confuse me (well, the whole functions does) in the top functions.
First, dir * p where ...
0
votes
0
answers
102
views
Dark line artifact along edges of the shaded mesh
I have implemented an algorithm to calculate vertex normals by taking the normalized average of all its adjacent triangles. I have subdivided a cube two times with catmull clark and checked the ...
0
votes
2
answers
547
views
Gouraud Shading interpolates color across a triangle using vertex normals. Phong Shading interpolates normals. How are their end-results different?
I am struggling to understand as to why fundamentally triangles shaded through Gouraud shading and ones shaded through Phong shading look different.
From my understanding, Gouraud Shading, takes the ...
2
votes
1
answer
457
views
How exactly does Gouraud shading apply color across a polygon? Does it do it by pixel or is it some other method?
I'm a super beginner to GFX. So far I've learned about 3 shading models when rendering meshes
The first is Flat Shading. I seem to understand this, from my understanding, you take the normal of the ...
0
votes
2
answers
942
views
How to calculate vertex normals on a mesh with non-planar polygons
If I have a mesh consisting of polygons that are not necessarily triangles and not necessarily planar. As answered in the previous question I asked, there's no correct answer to calculating normals ...
1
vote
1
answer
101
views
Why do 3d modeling packages use a single normal per polygon and how is this viable for smooth shading
If we have a quad that is non-planar. Why do most 3d modeling packages choose to use a single normal for the quad (Specifically for Blender3d by using cross product of two edge's vectors that do not ...
2
votes
1
answer
113
views
Determining the function of a radial gradient fill with midpoint
Recently I have been trying to create a shader that imitates a shader within Affinity Photo. It is used in the radial gradient fill and essentially you set your endpoint colors and then set the ...
0
votes
1
answer
109
views
What effects are used to light this scene?
I am interested how that image on the right of the slider (just albedo) can produce such a realistic looking scene as the scene on the left.
What effects (at a minimum) does this scene seem to be ...
0
votes
0
answers
94
views
Help me understand the derivation of this tangent space to object space matrix
I was trying to follow this http://foundationsofgameenginedev.com/FGED2-sample.pdf
But had problem understanding formula 7.33.
$$p_i-p_j=(u_i-u_j)\mathrm{t}+(v_i-v_j)\mathrm{b}$$
* $p_i,p_j$ being ...
0
votes
1
answer
104
views
Stylized math like rendering?
How can I render plots and graphics that mimic how mathematicians draw diagrams?
For example Look at this shirt:
The diagrams represent 2D and 3D shapes, however they have characteristics of human ...
0
votes
0
answers
36
views
Changing shader color
I have the following .fx file for my shader:
...
0
votes
2
answers
210
views
Lambertian shading illuminates all the front of a sphere
I've sucessfully implemented a ray tracer from scratch in C and it's marvelous:
The surface normal on this sphere is taken by computing the intersection point, A, and treating this as a euclidean ...
0
votes
1
answer
323
views
Phong model: why no multiplication by N dot L in specular term?
Classical Phong reflection model, as described on wikipedia, computes diffuse and specular light as follows:
...
1
vote
1
answer
670
views
OpenGL Render front and back faces with different shading for 3d modeller
I'm working on a simple 3d modeller and I would like to render the back facing triangles a bit darker, to easier differentiate between front and back faces. Like you can see in most modelling ...
1
vote
1
answer
85
views
Do we have OpenGL shaders write out the intermediate *.o-esque file on first compile so that we can skip compiling them in run-time every single time?
Shaders get compiled during runtime every single time an app starts. I understand the reasoning for this is that there are so many GPU architectures out there that it does not make sense to ship pre-...
0
votes
1
answer
547
views
How to read illum value from mtl file using Assimp library?
I am loading an OBJ file using the ASSIMP library. Following is the MTL file associated with the obj file.
...
2
votes
1
answer
113
views
Point light illuminating only half of a scene
A point light is illuminating only a half of a scene in my small 3D renderer. It happens on every scene I've tried (conference room, cornell box, etc).
How do I go about debugging this? What could ...
3
votes
0
answers
118
views
Irradiance field approximation with black probes
I'm posting here after some time searching the Internet and reading presentations and papers, to find out the best options to solve the problem I have.
I'm implementing irradiance field with ...
2
votes
1
answer
878
views
Difference betwen Rendering Equation, Lighting model, Ray Tracing, Global Illumination and Shadows?
What is the difference between all these techniques? I know what a lightning model does, eg Phong, Flat, Gouraud. As far as I know both Ray Tracing and Global Illumination are just lighting models ...
3
votes
1
answer
222
views
What's the justification of multiplying colors together?
In Phong shading model (and other shading models as well), the light color is multiplied together with the surface color component-wise. I want to know the justification for this. Is this some what ...
1
vote
3
answers
1k
views
What is the algorithm used for phong shading normal interpolation?
Let's suppose we have an object consisting of only 3d points, and triangle faces that each take a subset of these 3d points. How can I interpolate the normal vectors to get that Phong smooth shading? ...
0
votes
0
answers
2k
views
Color shading and light calculation for ray tracing
I am currently building a ray tracer and I came across a problem and confusion regarding the light calculations. For lighting, I am using the following mathematical model:
Where ...
4
votes
1
answer
115
views
How to approximate the heightmap of processed wood?
In the above image, you can see that there is some slight variation of the height of each wood plank. These variations do NOT come from the wood texture itself, but from the way it was cut, i.e if a ...
1
vote
2
answers
316
views
How are colors really mixed?
I'm kind of stuck on this one. When following a conventional, high-level shading tutorial, you'll come across these images that are like ambient + diffuse + specular = result, but I can tell that it's ...
5
votes
0
answers
271
views
Why is Forward Rendering/Shading named this way?
Forward rendering is the 'classic' approach to the rendering pipeline.
Nowadays it is mostly replaced by a more flexible, deferred rendering approach.
I did some research and had trouble finding ...
2
votes
2
answers
285
views
Physically Based Shading for Diffuse surfaces
So I am currently in the process of implementing Physically based Shading in my pathtracer using microfacet models and I'm quite stuck at comprehending light interaction with diffuse surfaces.
First ...
4
votes
1
answer
3k
views
How is lighting done in Rasterization based pipeline?
So I wanted to know how do Game Engines like Unity3D and Unreal do lighting. I'm familiar with Ray-tracing, pathtracing based renderers etc. But not much with rasterization based engines. I do know a ...
3
votes
3
answers
2k
views
3ds max: Z-fighting when working with Large Objects
I had a z-fighting/z-clipping issue with a scene containing some very large objects yesterday in 3ds max. It can be seen in the image below:
For some reason downscaling the scene significantly (a ...
3
votes
1
answer
468
views
Smooth shading on sphere approximation
In what way is a "cheat" when using smooth shading on a sphere approximation?
I'm not understanding how it's a cheat to use smooth shading on this?
Other questions that are lead after this may be:
...
0
votes
1
answer
398
views
How are normals assigned to vertices in different types of shading?
I'm new to this forum and topic but wanted to figure out specifically how are normals assigned to vertices in flat shading, gouraud shading, and phong shading?
Is there a difference between any?
6
votes
1
answer
223
views
"Artist Friendly Metallic Fresnel" reversible?
While implementing the "Artist Friendly Metallic Fresnel" paper by Ole Gulbrandsen (http://jcgt.org/published/0003/04/03/paper.pdf), I read that it is fully reversible:
(section 2.3.2): for all r,g ...
1
vote
1
answer
796
views
Project vertex onto plane
What I have:
a plane given by its normal$\ n $ and a point on the plane$\ p $.
a 3D-point$\ v $.
a direction$\ d$.
What I need:
the projection of$\ v$ along$\ d$ onto the plane.
How can I ...
5
votes
1
answer
3k
views
How to compute normal of surface from implicit equation for ray-marching?
I want to represent ovaloids with ray-marching. I have ovaloids defined with an implicit equation.
For instance, we can consider the equation of an ellipsoid given as: $$ \frac{x^2}{a^2} + \frac{y^2}...
6
votes
2
answers
459
views
PBR missing rim darkening on non metallic rough surfaces
If you have a dielectric (non metallic) sphere with a large roughness value (say, 0.95), and put it in a lighting environment that has a constant onmidirectional lighting value (such as 0.5) Cook-...
1
vote
1
answer
97
views
What does "region to be shaded" mean in the PCF paper?
I am reading the percentage closer filtering (PCF) paper by Reeves, W. et al. (https://graphics.pixar.com/library/ShadowMaps/paper.pdf).
At at section 3.2, it mentioned that "each shading calculation ...
0
votes
1
answer
525
views
How to use shadow mapping and deferred rendering to create a large amount of lights?
Ok so I am trying to understand how to combine these 2 techniques and I am failing.
The main goal is to reach the O(lights+fragments) complexity of deferred rendering, instead of O(lights*fragments) ...
2
votes
0
answers
83
views
How can you efficiently get the last element occluding light when rendering shadows?
A long time ago I made an application that used volumetric rendering and I developed some shadowing equations that I felt very happy with, since they have pretty good results.
For these equations to ...
3
votes
2
answers
284
views
Inconsistent shading in pathtraced image
I am currently building a pathtracer, which has support for vertex normals and face normals.
There seems to be an issue when it comes to rendering objects with triangles exported from Blender. ...
2
votes
1
answer
591
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 ...
6
votes
1
answer
2k
views
Microfacet shading for diffuse materials
I recently replaced the Lambertian BRDF in my path-tracer with Oren-Nayar, under the assumption that I could adjust it to use the GGX distribution model with appropriate masking/shadowing.
PBR ...
3
votes
1
answer
186
views
Paper for the approximation formula provided by Brian Karis
In these slides, specifically page 11, the following formula is reported:
$$
\frac{1}{N} \sum_{k=1}^N \frac{L_i(l_k)f(l_k,v)\cos(\theta_{l_k})}{p(l_k,v)} \approx \left( \frac{1}{N} \sum_{k=1}^N L_i(...