Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [shading]

The tag has no usage guidance.

0
votes
0answers
15 views

Writing an underwater wave water refraction shader

While there are plenty of online tutorials out there on underwater effects very few of them help with creating the effect of being near the surface where volumetric rays are cast down and when you ...
3
votes
1answer
154 views

Object made of cubes looks different based on the distance in Unity3D?

I made a "Wall" from basic Unity3D cubes. They are placed tightly so the wall looks like one big rectangular prism. If I look at it from close distance, it looks as it should be: one big rectangular ...
0
votes
1answer
114 views

Is Quake 3's shader language copyrighted?

Right now I am using Quake 3 tools to make maps for my graphics engine, to have some kind of start and an idea on how to build one from scratch. I know that the BSP format is copyrighted and maps made ...
4
votes
3answers
2k views

How do I implement flat shading in GLSL?

I'm working with GLSL and trying to implement flat shading on a 3D model (rather than smooth shading). To illustrate what I mean, here are two screenshots of cubes in Blender. Here's one with flat ...
5
votes
1answer
208 views

Real time lighting in a 2D game with angled camera perspective

The game "Monaco: What is yours is mine", has a nice real time lighting/shading effect as shown in this picture: Notice how the vision is blocked by obstacles. I would be interested in seeing if this ...
2
votes
2answers
166 views

Implementing spot lights in Vulkan and some pixels are black

TL;DR; I have come to the conclusion that the problem is linked to the spot light being too close to the camera. Which only made me more confused. Long version; I have sat with this my whole day and ...
0
votes
1answer
118 views

Monogame problem with flat shading low poly terrain

I have been dabbling in 3d rendering recently and I am having a problem with the shading on the mesh I am using. The code I am using to calculate the normals for all the triangles is as follows. <...
0
votes
1answer
32 views

The difference between shading and data interpolation

Using methods like Phong you can make mesh look smooth and real. However you can do the same interpolation at the data level creating a surface (for example B-Spline surface). What is the difference ...
0
votes
0answers
39 views

DuDv Map has seams

I've made a dudvMap to give my water a ripple effect, however it is giving it a repeated look and I can see the areas where two textures on the water meet It's a little hard to see here, but if you ...
1
vote
1answer
220 views

How to achieve good looking surface net normals?

EDIT After Victor T.'s suggestion (ignore seams): I'm using elastic surface nets to convert a 3D voxels into a nice smooth mesh. The mesh part, is great, however, I can't seem to find a decent ...
3
votes
1answer
334 views

How to make this generated terrain flat-shaded?

I'm generating a relatively low-poly terrain for my game using the code below: ...
0
votes
1answer
116 views

Phong: Real-time rendering of Metal and Plastic Materials

Using a shader that works like Phong, what would be the difference between painted Metal and plastic? I seem to remember reading in books that I no longer have access to, the following: Specular ...
1
vote
1answer
87 views

What am I supposed to pass shaders to?

I don't think I fully understand how rendering shaders work. I get that you give a shader to an object/sprite when drawing it, and it applies the shader to it. But I don't think I'm doing it right. ...
0
votes
1answer
58 views

Identify shading language in Trove

I'm playing this voxel game named Trove, running it in DirectX, their requirements are DirectX 10 and OpenGL 3.2 The character entity in this game emits light when it gets close to any surfaces (...
0
votes
2answers
1k views

What is the best way to draw outline of object using OpenGL

I want to select the best way to draw outline of 3d human like object and what would be the best way to draw outline for this kind of objects. I found about stencil buffer based methods, geometric ...
0
votes
1answer
422 views

Apply shading to Solid Sphere? OpenGL C++

To Apply shading to an object. Let's say earth (which was textured using an image). So how to apply smooth shading to that? What are the steps I need to write? Using which functions? Thank you. Code ...
0
votes
3answers
332 views

Difference in Shading Using Eye Space or Model Space Coordinates

While reading on shading, I came across a section in which the artist provides 2 different kinds of fragment shading: Coloring using model space and eye space. The result is as illustrated in the ...
0
votes
0answers
80 views

OpenGL harsh lighting on model

I'm messing around with textured shading, but it appears to be doing something very odd with the lighting. Here is a little hat I made. It is the only textured model in the scene, the other models ...
3
votes
1answer
432 views

Physically based shading - ambient/indirect lighting

I implemented a physically based path tracer after studying PBRT by M. Pharr and G. Humphreys. Now I'm trying to apply physically based rendering to real time graphics using OpenGL. I want to start ...
2
votes
1answer
86 views

Radiance arriving at or leaving a surface

I was reading this text about radiance and according to the next figure, both leaving and arriving radiances' solid angles are anchored on the surface point? My logic tells me that the solid angle of ...
0
votes
1answer
185 views

How should I apply Ambient Occlusion from greyscale AO maps?

I've seen many tutorials on SSAO, but none for simple ambient occlusion maps. I can see myself working things out alone, as AO maps are simple greyscale maps that indicate where there should be more ...
11
votes
2answers
254 views

Why is the distance from object to eye irrelevant in illumination models?

For example in Phong model and Blinn model, the light intensity does not change depending on how far away the camera is. Why is that?
1
vote
0answers
764 views

Smooth+Flat shaded meshes cause shadow artifacts (understanding the source of the problem)

I'm using blender to create assets to use in Unity3D, and I'm having some trouble understanding how the smooth/flat shading interacts with shadows, I'm sorry if it has been asked before, but all the "...
0
votes
2answers
56 views

What mistake did I make? Source engine reskin issues

Here is a reskin of the Half Life 2 Wallace Breen model that I made for a mod I am developing, but the checkerboard on the suit is very odd. All my other skins have no issue, but this skin has ...
2
votes
0answers
145 views

Editing sprite shading to change perspective?

I'm currently developing an RPG in Java with some of my friends, and one of my tasks is to do the pixel art. I'm a beginner at it, but I know that I'll get better in time. I recently finished the ...
3
votes
1answer
906 views

What are the advantages of tangent space shading/lighting, and what about attenuation?

In several topics here it was suggested by people that doing lighting in tangent space is better than doing it in world space. Right now I am doing it in camera space, but it's really similar to world ...
1
vote
1answer
961 views

How does an energy-conservative Blinn-Phong-Fresnel model work?

What is a plausible, basic equation/pseudo-code for energy-conservative Blinn-Phong shading, including Fresnel with a coloured light-source? The net gives so many alternatives that it's hard to ...
2
votes
0answers
743 views

Uniform Buffer Binding-points

I believe Uniform Buffers/Blocks has been the hardest thing to grasp in OpenGL. Hopefully this will be my final issue regarding this. I have created a uniform buffer that contain data of ...
0
votes
1answer
118 views

MD5Mesh Calculate Vertex Normals

I am writing an MD5 3D model loader to display animated models. The vertices and texcoords load in correctly, but the lighting is supposed to be smooth. I calculate per-vertex normals by looping ...
8
votes
1answer
1k views

physically based shading, how to combine specular & diffuse parts?

After writing 'standard' phong & blinn shaders for a while, I recently started to dabble in physically based shading. A resource that helped me a lot are these course notes, especially this paper -...
1
vote
1answer
3k views

Can I use flat shading on a generated mesh?

I tried to generate a mesh from code in Unity. The problem is, that the edges are automatically smoothed. When I import a model into Unity, I can set the smoothing angle of the edges, but is something ...
1
vote
3answers
433 views

Mathematics behind Phong shading and additive blending

I'm confused about the mathematics behind additive blending used in conjunction with Phong shading. Intuitively, it seems like you would need to use a floating-point framebuffer and some sort of tone-...
22
votes
3answers
6k views

Why is H (blinn) used instead of R (phong) in specular shading?

I can't find a good reason for this anywhere. The reflection vector used in phong has a simple basis in physics. But the half vector used in blinn seemingly has no rational basis, and does not ...
0
votes
0answers
740 views

OpenGL shading doesn't work with different projection and view matrices?

I found an online (public-domain) code to do marching cubes, and I am trying to adapt this code to work in my own project. The code uses GLUT and "older-style" OpenGL, whereas I am using GLM and GLEW/...
0
votes
1answer
96 views

OpenGL strange rendering problem when buffers have different sizes

I have encountered a very odd error in my program, "odd" in the sense that everything the API says suggests that the error should not occur. I have a bunch of 2D un-indexed vertex data, and I want to ...
8
votes
1answer
366 views

Specular banding with high specular power

We're having some issues with our ray tracing in DirectX, especially with some serious banding issues with specular. With high specular power (above 8) banding starts. I'm wondering if this is an HDR/...
1
vote
0answers
828 views

How to shade hair (line segments) correctly in GLSL

I render my hair geometry in line segments. The problem I have is with the correct shading of the hair. From what I've read I understood that I need the direction of the line segment and the ...
1
vote
1answer
975 views

Strange rendering in XNA/Monogame

I am trying to render G-Code generated for a 3d-printer as the printed product by reading the file as line segments and the drawing cylinders with the diameter of the filament around the segment. I ...
5
votes
3answers
824 views

How to skip the sky in lighting shaders?

I recently implemented a sky in my deferred rendered game. It is a procedurally calculated sphere with a texture applied to it. Unfortunately all lighting shaders (light sources, ambient occlusion) ...
3
votes
1answer
736 views

Enhancing ambient occlusion via vert colors on vertex lit scene

We have a deformable terrain surface. Initially ambient occlusion was baked, but since the terrain can deform in real time, this approach isn't practical anymore. Therefore we used vertex paint to ...
0
votes
3answers
292 views

help using image to overlay grayscale around player

I'm sorry for the confusing title but it is hard to explain in one sentence. This is what I have What I want to do is use that black overlay to convert everything in the black area to grayscale. ...
4
votes
1answer
1k views

OpenGL lighting with dynamic geometry

I'm currently thinking hard about how to implement lighting in my game. The geometry is quite dynamic (fixed 3D grid with custom geometry in each cell) and needs some light to get more depth and in ...
11
votes
2answers
9k views

Shadows in deferred rendering

I've read some material about deferred rendering, and I think I get the gist of it. But what I don't understand is how it accomplishes shadows. The G-buffer, as far as I'm aware, does not involve ...