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
1
vote
1 answer

How to make the shading reach the edges of the graph?

I'm new to matplotlib and I'm trying to learn how to shade the area between two horizontal lines in a bar chart, and I wanna know how I can make it reach the edges. Here is an example: import numpy as np import matplotlib.pyplot as plt N = 8 A =…
Matsukazi Issy
  • 109
  • 2
  • 8
1
vote
1 answer

Shading by different colors between two lines of a graph created by pandas data frame

I am trying to shading between the lines of a graph. I tried by using plt.fill_between() but it does not works. Here, are my code for your information. Please note that I want to shade between the green and orange color lines as shown in the…
monir zaman
  • 309
  • 1
  • 3
  • 13
1
vote
1 answer

Calculate maximal reflection (Lambertian)

Given a surface point P at (1,0,0), a normal direction (1,1,0) as well as a point light source at (1,2,0). If we assume that the surface point P is perfectly diffuse, to what location would the light have to move to achieve a maximal reflection…
user9955719
1
vote
1 answer

Calculating the diffuse r,g,bvalue of pixel on raytracer using Blinn-Phong

I am trying to calculate the RGB value of a pixel using the Blinn-Phong formula. For that I use this function: Material getPixelColor(Ray ray, double min, int index, std::vector Objects, std::vector lightSources) { Vector…
Thanos T.
  • 182
  • 1
  • 3
  • 9
1
vote
1 answer

IOS Metal Fragment shader file compilation

I have fragment shader "fsh" file and I am trying to compile it, it is originally taken from Shadertoy, and it is in GLSL, I am trying to port it to METAL, and I am getting the following error: program_source:129:12: error: program scope variable…
Burak Ozdemir
  • 75
  • 1
  • 1
  • 6
1
vote
2 answers

How to put a rectangle in the key with same hue as a shaded area in Gnuplot?

I have some shaded area in a plot and I'd like to label that shaded area with a small rectangle of the same hue as the shading in the plot. I'm using gnuplot - my shading in the plot is achieved with plot 'XXXX.dat' u 1:($2+$3):($2-$3) w…
CAF
  • 329
  • 3
  • 14
1
vote
1 answer

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 worked for a single sphere, but now I've updated the…
JerSci
  • 167
  • 1
  • 9
1
vote
1 answer

OpenGL diffuse/specular light not rendering (only ambient) on polygons

I have setup the lighting to the best of my understanding but all that renders is Ambient lighting. It seems to work on built-in shapes like glutSolidSphere and glutSolidCube, but not my manually coded polygons. I have spent hours reviewing…
Jonah M
  • 300
  • 2
  • 13
1
vote
1 answer

Apply smooth shading to render object in three js

I try to apply a smooth shading to render my object in order to smooth (first image) my faceted shading (last image). I compute my vertex normal by taking summing all neighboring triangles normal, then normalizing it. For certain area, it looks…
Valimo Ral
  • 381
  • 2
  • 15
1
vote
1 answer

How can I plot a single 2-D curve onto a colormap in Matlab?

I have created a smooth color gradient 2-D contour plot with existing compiled data in Matlab. I have an x-axis, y-axis, and z-data contour plotted as a colormap. My goal is to plot a 2-D curve onto the colormap, representing a single z-data value,…
1
vote
0 answers

Bizarre colors doing phong shading on ray-tracer

I recently added support to phong shading in a cpu ray-tracer and the colors are all messed-up: If I just do diffuse: Some relevant code: Vec3f camera_dir (xx_array[x],py,scene->getCameraDirZ()); camera_dir.normalize (); Vec3f hit_normal =…
user2752471
  • 444
  • 1
  • 6
  • 14
1
vote
1 answer

How to Gouraud shading with diffuse lighting in WebGl?

I stuck with implementing Gouraud smooth shading. I'm missing something and I need help. First about diffuse lighting. To get diffuse light I'm using this formula: Id * Kd * max( dot(N,L), 0.0) I should get my diffuse color and I will add it to my…
Stas Jus
  • 13
  • 4
1
vote
1 answer

Error in compiling the examples of OpenGL 4 Shading Language Cookbook, 3rd Edition

I downloaded the source code of OpenGL 4 Shading Language Cookbook, 3rd Edition from PacktPublishing github I have downloaded the glm source code version glm-0.9.9.3 and I have downloaded the glfw source code version glfw-3.2.1. I successfully…
Arun AC
  • 417
  • 7
  • 17
1
vote
1 answer

Shading in ggplot

This is the data set: structure(list(Date2 = structure(c(17702, 17703, 17704, 17705, 17707, 17711, 17715, 17716, 17716, 17716, 17717, 17719, 17722, 17728, 17736, 17738, 17738, 17738, 17739, 17741, 17749, 17756, 17757, 17758, 17759, 17760,…
Kyle
  • 27
  • 5
1
vote
1 answer

Fill in area between lines on 3D line plot Python

I have a 3D line plot with 13 lines on it. I want to shade in the area between the lines (along the y axis) to give it a shaded hill look. Is there a way to do this? I have tried converting the data I have to a 2D array so that I can make a…