Questions tagged [shading]

Shading refers to depicting depth perception in 3D models or illustrations by varying levels of darkness.

Shading refers to depicting depth perception in 3D models or illustrations by varying levels of darkness. (source: Wikipedia).

119 questions
8
votes
1 answer

MATLAB pcolor/surf bilinear interpolation (shading interp)

Consider the following MATLAB code: C = [ 0 0 0 0 0 0 1 2 1 0 0 2 4 2 0 0 1 2 1 0 0 0 0 0 0 ]; pcolor( C ); shading interp; axis square Note that C is invariant under 90 degree rotations. Also note this sentence from the…
cfp
  • 208
  • 1
  • 7
7
votes
4 answers

How do I load roughness/metallic map with Assimp using gltf format?

I try to load a scene that's in gltf format. It has metallic and roughness textures (not embedded). Now I want to load the model with the specified textures using Assimp. I retrieve the textures using GetTexture(), but aiTextureType doesn't have…
DaOnlyOwner
  • 343
  • 3
  • 8
5
votes
2 answers

GLSL performance differences between function call vs. inlining

Does it make a performance difference in GLSL if something simple like a + operator is wrapped into a function? So for example these two scenarios: Example 1: in uniform float uValueA; in uniform float uValueB; void main() { float value =…
Daniela
  • 51
  • 1
  • 3
5
votes
3 answers

Scala + SBT - How to configure reference.conf for a shaded Akka library

TL;DR I am trying to shade a version of the akka library and bundle it with my application (to be able to run a spray-can server on the CDH 5.7 version of Spark 1.6). The shading process messes up akka's default configuration, and after manually…
Johan Hirsch
  • 557
  • 4
  • 21
4
votes
1 answer

How to interpolate normals for Phong shading in OpenGL?

Currently, I am implementing good old Phong shading. Overall it looks quite right but there is a pattern in the normals emerging, that I cannot explain. Without a closer look, the Stanford Bunny looks quite correct, I think. But on the ears for…
Henkk
  • 609
  • 6
  • 18
3
votes
2 answers

Swift UI shading only outside of symbol

Here are two SF symbols, one with some shading. As you can see, not only is the outside of the second symbol shaded, but so is the inside. How would I shade only the outside, leaving the inner whitespace white rather than shaded? Ideally a solution…
John Sorensen
  • 710
  • 6
  • 29
3
votes
1 answer

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 based on that interpolated value. However, when…
v4vendeta
  • 43
  • 1
  • 5
3
votes
0 answers

WebGL triangle wrong lighting

I have a question, probably similar to this one: WebGL shading/lighting too dark on some triangles I am trying to port one of my old exercises from C++ OpenGL which uses deprecated glaux, to WebGL. The problem is that cone shows wrong lighting, weak…
armagedescu
  • 1,758
  • 2
  • 20
  • 31
3
votes
1 answer

OpenGL Normals not appearing in triangles

I'm using a normal array to render a normal dataset as follows: glEnableClientState(GL_NORMAL_ARRAY); glNormalPointer( GL_FLOAT, 0, nArray ); My vertices are rendered as follows: glEnableClientState( GL_VERTEX_ARRAY ); glVertexPointer( 3, GL_FLOAT,…
tester
  • 415
  • 1
  • 5
  • 17
3
votes
1 answer

Python animation shadings matplotlib

So I am trying to create an animation of a few Gaussian Graphs that move over time. I have the basic animation working as I intended it too. But then I wanted to shade the area under the Gaussian Curves. I used ax.fill function to shade it. But…
3
votes
1 answer

Metal Shading Language - FragCoord equivalent?

I tried to translate this shadertoy scene into Metal Kernel. In shadertoy code: void mainImage( out vec4 fragColor, in vec2 fragCoord ) { vec3 dir = rayDirection(45.0, iResolution.xy, fragCoord); ... } in OpenGL case, we need to send…
sooon
  • 4,718
  • 8
  • 63
  • 116
3
votes
0 answers

PBR GGX specular desaturated color

I am trying to implement PBR renderer. My specular highlight has desaturated color (especially in grazing angles) and escapes my light volume bounding sphere. Why is this happening? The function I use to calculate GGX specular: vec3…
Matej Kormuth
  • 2,139
  • 3
  • 35
  • 52
3
votes
2 answers

Cook-Torrance shader cuts off really weird when NdotL <= 0

So i've been trying to implement the Cook-Torrance shader model in a toy project I'm working on and it looks quite good when looking at the right angle: But when you're looking from a shallow angle the visuals you get bright artifacts and around…
user6542177
2
votes
0 answers

Gouraud Shading in JavaFX

Each face has 3 colors (one for each vertex). I want to use Gouraud shading to blend these colors. So far, I have taken some inspiration from the FXyz library. My current approach uses the setTextureModeVertices3D from the FXyz library. But this…
2
votes
2 answers

Better shading on BW display while rendering filled surfaces

Prologue I finally got around HW incompatibility between AT32UC3xxxxx and SSD1306 OLED I2C display (both have HW bugs making them incompatible) allowing me to use HW I2C at 400KBaud (~26.6ms per frame). So I decided to rewrite my old driver for this…
Spektre
  • 49,595
  • 11
  • 110
  • 380
1
2 3 4 5 6 7 8