Questions tagged [shading]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
60 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 ...
Enigmatisms's user avatar
2 votes
0 answers
48 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 ...
J. H's user avatar
  • 21
0 votes
1 answer
125 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 ...
mbl's user avatar
  • 291
2 votes
1 answer
43 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 ...
Trong-Thang Pham's user avatar
1 vote
2 answers
278 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 \...
jwodder's user avatar
  • 119
0 votes
0 answers
90 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/...
playerJX1's user avatar
  • 101
0 votes
1 answer
187 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 ...
Simon's user avatar
  • 163
1 vote
1 answer
191 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$...
S. M.'s user avatar
  • 211
1 vote
2 answers
243 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 ...
neo-mashiro's user avatar
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 ...
Jeff Streepe's user avatar
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 ...
Lenny White's user avatar
0 votes
2 answers
735 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 ...
Hash's user avatar
  • 157
2 votes
1 answer
697 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 ...
Hash's user avatar
  • 157
0 votes
2 answers
1k 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 ...
Lenny White's user avatar
1 vote
1 answer
111 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 ...
Lenny White's user avatar
2 votes
1 answer
121 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 ...
CalebK's user avatar
  • 243
0 votes
1 answer
111 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 ...
jackw11111's user avatar
0 votes
0 answers
98 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 ...
Eugene's user avatar
  • 111
0 votes
1 answer
108 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 ...
Makogan's user avatar
  • 1,696
0 votes
0 answers
37 views

Changing shader color

I have the following .fx file for my shader: ...
Alexander Mills's user avatar
0 votes
2 answers
231 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 ...
Spade 000's user avatar
0 votes
1 answer
379 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: ...
Kuba's user avatar
  • 3
1 vote
1 answer
790 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 ...
Lenny White's user avatar
1 vote
1 answer
95 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-...
Harsh's user avatar
  • 113
0 votes
1 answer
628 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. ...
user13184's user avatar
2 votes
1 answer
133 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 ...
Ohkomonkiainen's user avatar
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 ...
Alex's user avatar
  • 31
2 votes
1 answer
988 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 ...
KeyC0de's user avatar
  • 145
4 votes
1 answer
301 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 ...
Rui Liu's user avatar
  • 141
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? ...
AnnoyinC's user avatar
  • 312
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 ...
Abdullah Emad's user avatar
4 votes
1 answer
119 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 ...
Makogan's user avatar
  • 1,696
1 vote
2 answers
327 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 ...
AnnoyinC's user avatar
  • 312
5 votes
0 answers
301 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 ...
LukeG's user avatar
  • 151
2 votes
2 answers
312 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 ...
gallickgunner's user avatar
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 ...
gallickgunner's user avatar
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 ...
Maarten -Monica for president's user avatar
3 votes
1 answer
512 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: ...
user9778's user avatar
  • 191
0 votes
1 answer
452 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?
user9778's user avatar
  • 191
6 votes
1 answer
230 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 ...
zeno's user avatar
  • 138
1 vote
1 answer
841 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 ...
Dmitrii C.'s user avatar
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}...
EvaMGG's user avatar
  • 153
6 votes
2 answers
471 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-...
Alan Wolfe's user avatar
  • 7,791
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 ...
yuchen's user avatar
  • 465
0 votes
1 answer
530 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) ...
Makogan's user avatar
  • 1,696
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 ...
Makogan's user avatar
  • 1,696
3 votes
2 answers
297 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. ...
Oliver Cruickshank's user avatar
2 votes
1 answer
628 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 ...
Daniel Marques's user avatar
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 ...
Paul Ferris's user avatar
3 votes
1 answer
193 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(...
user8469759's user avatar