Most Popular
1500 questions
3
votes
1 answer
Why is my fragment shader not showing any colors?
I am basically following this tutorial about diffuse lighting in OpenGL.
I did some modifications but the idea is the same, at least that's what I think. However, my fragment shader is not showing any colors. I checked and rechecked my uniform…

BRabbit27
- 969
- 1
- 10
- 21
3
votes
1 answer
Incorrect values written in stencil buffer
I am trying to pick objects on mouse click. For this I have followed this tutorial, and tried to use the stencil buffer for this purpose.
Inside "game" loop I am trying to draw 10 (5 pairs) 'pick'able triangles as follows:
...
glClearColor(red,…

Sayan Pal
- 263
- 1
- 9
3
votes
1 answer
Fastest shader compilation strategy on windows dx9 and dx11?
To compile shaders, I currently spin up a thread per core where each thread pulls a shader from a list and calls D3DX11CompileFromFile for dx11 and D3DXCompileShaderFromFile for dx9.
I've heard it mentioned that spinning up multiple processes…

Alan Wolfe
- 7,801
- 3
- 30
- 76
3
votes
2 answers
How does a GPU process a task by using multiple ALUs?
I know the philosophy of how a GPU works {many weak men doing a task (GPU) compared to one strong man doing the same task (CPU)}.
How does the GPU manage all the ALUs and schedule the necessary calculation to an ALU?

Karan
- 31
- 1
- 2
3
votes
1 answer
Components that can be used for 3d shadow analysis, sunhours of surfaces throughout the year in a 3d model?
I want to develop a component for 3d shadow analysis of 3d city model. I decided to use ray tracing for this purpose. For every time step (for sun's dynamic position during the year) rays will be sent from sun (point light source) and with ray…

Ziya6161
- 33
- 3
3
votes
2 answers
What are the differences between GPU instancing and standard instancing?
I have been reading a lot of debate on a new feature that will be available in the new version of the game engine Unity 5.4 - called GPU instancing. I understand the importance of instancing in general, both in terms of saving memory and draw…

Louis15
- 273
- 2
- 5
3
votes
1 answer
Hlsl - registers type
Is there any difference between registers types in hlsl?
For example when using register t0 for UAV will it be somehow precache like textures?
According to microsoft's presentation about resource in DX12 and hlsl 5.1 this registers mean nothing, but…

Derag
- 596
- 3
- 13
3
votes
1 answer
Midpoint algorithm
I am going through one of the most basic line drawing algorithms and stuck with the following mathematical explanations. The implicit function of line equation is:
f(x,y) = ax + by + c
The Book(Computer Graphics , Principles and practice) mentions…

sajis997
- 1,279
- 1
- 10
- 15
3
votes
1 answer
Image rotation algorithm
I would like to rotate a raster image by an arbitrary angle. I don't really care for speed: the rotation should be of highest quality possible. Could someone please suggest a suitable algorithm?
I'm familiar with the rotation by three shears but I'm…

Ecir Hana
- 1,459
- 11
- 20
3
votes
2 answers
Matching an HSV color with a blended color
This is hard to explain but I am going to try, then I will explain it as pure mathematics.
Look at this image.
So basically this is a moving line, each frame a new segment is added and the previous frame is faded by an amount decided by fps. (There…

J.Doe
- 1,445
- 12
- 23
3
votes
1 answer
Does a point have a length?
I am going though a functional source that has the following class:
class Point3D
{
int x ,y,z;
int vSize2() const
{
return x*x +
y*y +
z*z;
}
int vSize() const
…

sajis997
- 1,279
- 1
- 10
- 15
3
votes
1 answer
How to detect a screen in a photo
Is there a way to make a difference between a photo of an actual object and a photo of an object through a computer or smartphone screen.
For example: how can I detect that the second image is taken from a screen?
Thank you very much!

Hugo
- 31
- 2
3
votes
0 answers
Constructing base mesh for required subdivision surface
Given a triangle mesh, does there exist any algorithm to compute a base mesh (smaller in size than the triangle mesh) that could be subdivided multiple times to get back the original mesh (or an approximate of the original) ?
Thanks!

xperien
- 31
- 1
3
votes
2 answers
Double rasterization work on triangles edges.
I know that fragments are rasterized in a 2x2 quad. That's why the seam between two triangles can be rasterized twice. At least that article states this. I wonder is it still true today on modern hardware?

nikitablack
- 711
- 4
- 15
3
votes
1 answer
What is causing this odd scaling behavior?
OK so I have a simple setup going on. Basically I am just drawing some textures and shapes. However sizing is going weird... let me show you how any maybe you can diagnose.
Basically everything is broken into components that work fine by…

J.Doe
- 1,445
- 12
- 23