Most Popular

1500 questions
5
votes
2 answers

Problem with Basic Diffuse Lighting

So recently I have been learning how to implement Diffuse Lighting in DirectX and I have done so with the following code: float4 PS(VS_OUTPUT input) : SV_TARGET { input.normal = normalize(input.normal); float4 diffuse =…
Arjan Singh
  • 2,511
  • 3
  • 22
  • 38
5
votes
2 answers

Why does rotation about an arbitrary axis have degree of freedom 6

I have been trying to figure out why does rotation about an arbitrary axis have degree of freedom 6. I know that it takes two points, each take 3 values to determine in a 3-D space. But what about the rotation angle? Wouldn't that make the degree of…
Louis Kuang
  • 151
  • 2
5
votes
1 answer

Solving a problem from *Foundations of Computer Graphics*:

From Gortler's Foundations of Computer Graphics (i.e., self-study): Let $\mathbf{\vec{e}}^t = \mathbf{\vec{w}}^t E$ and let $P$ be a camera matrix that is just some arbitrary $4$ by $4$ matrix with "dashes" in its 3rd row. Given the world…
George
  • 253
  • 1
  • 4
5
votes
2 answers

Special directional light type

I am currently trying to implement a specific directional light type. This light type has been used in the game INSIDE and is called orthogonal spotlight (aka local directional light). I assume that this is a directional light which behaves like a…
MaT
  • 1,229
  • 10
  • 21
5
votes
1 answer

Optimizing performance on hardware

I'm working on a webgl audio visualizer that uses particles, and I want to optimize rendering based on the user's hardware. I'd like to offer a "low quality" and "high quality" setting so that it works well on a wide-range of devices. Is there a way…
Nick
  • 153
  • 3
5
votes
1 answer

The Process of Spherical Harmonics

I have read about spherical harmonics from Here about the usage of SH for generating Irradiance Environment Maps and how it can make the process of generating EM faster than the regular operations. what they say is : "if we want to generate a…
Joe
  • 53
  • 3
5
votes
1 answer

Error with tube lighting

I have recently been working on area lights for a small open source game engine called Urho3D but have run into an issues when rendering tube lights where the lights look the same as sphere lights despite the length value being changed. I am working…
5
votes
1 answer

Where is the best place for Tangent-bitangent calculation, in shader or in C/CPP code?

I have two methods of calculating tangent and cotengent (needed for normalMap lighting calculation). The one is doing it from CPP code (with assimp library for example) The second is doing it directly in shader (in Vertex shader/in fragment…
Irrmich
  • 153
  • 4
5
votes
1 answer

Confusion between usages of linear RGB and sRGB

Suppose you have generated an image using linear values for RGB channels. E.g. you linearly interpolated it when doing blending, etc.. When you're going to present this on the screen, should the values be transformed as $C_{\mathrm{linear}}\to…
Ruslan
  • 416
  • 3
  • 13
5
votes
1 answer

Where should I project a polygon corner when it is behind me?

I am creating a simple 3D engine as a learning project to get the hang on spherical trigonometry. I am using the following approach. 1. A model consists of a lot of triangular faces. 2. Each triangle is rendered through finding where the vectors…
5
votes
1 answer

Algorithm for adjusting the speed of a progress bar animation

I am trying to figure out an algorithm for handling an otherwise simple animation. I have a progress bar that "ticks down" from a user specified amount of time to zero. I wanted a smooth animation, so I chose to update it in a timer class at…
Jim
  • 153
  • 4
5
votes
1 answer

How do CAD programs render non-polygonal 3D objects?

How CAD programs handle displaying B-Reps and NURBS/T-Splines in their viewports? Assuming viewport uses OpenGL API - are those programs transform every object into triangles and creating/deleting vertex/index buffers when needed?
pmakal
  • 53
  • 3
5
votes
1 answer

Transformation Matrices

Consider the following problem and its answer: Given 3 points in 3D: $A=(A_x,A_y,A_z); B=(B_x,B_y,B_z) ; C=(C_x,C_y,C_z)$ Find the transformation matrix (in homogeneous coordinates) that performs a reflection around the plane spanned by the…
Jjang
  • 183
  • 3
5
votes
1 answer

Can we use PhysX in WebGL?

I'm new to GL stuff (coming in via WebGL, with no direct OpenGL experience). Can we use PhysX with WebGL?
trusktr
  • 255
  • 1
  • 6
5
votes
1 answer

GLSL - Merge two textures

I would like to display arbitrary 3d meshes with black edges (black outline, black ridges, etc.). Thereby I have created two different textures: One color texture and one anti-aliased edge texture. Here is an example of the color texture: And the…
enne87
  • 601
  • 2
  • 7
  • 15