Most Popular
1500 questions
5
votes
1 answer
Project quad onto ellipse in 3D
I have three points P0, P1, P2, which are located on an arbitrarily oriented ellipse in 3D space. I have a square texture map with a circle on it. I would like to render a textured quad (with the obvious UV mapping) so that the circle in the texture…
Russell Borogove
- 151
- 4
5
votes
2 answers
How to get the transform amount from a screen vector and a direction vector?
I am working on the move tool in a 3D modeling software. I need to know how much to move when the user drags an axis of the gizmo (for example along the x axis).
I have the 2D vector describing how much the mouse moved on the screen MouseDelta, and…
arthur.sw
- 377
- 2
- 14
5
votes
1 answer
Ray-triangle intersection algorithm not intersecting (C++)
I've been trying to implement the Moller-Trumbore ray-triangle intersection algorithm in my raytracing code. The code is supposed to read in a mesh and light sources, fire off rays from the light source, and return the triangle from the mesh which…
Haley
- 51
- 4
5
votes
0 answers
Indexing gl_TessLevelOuter[] with gl_InvocationID on a tessellation control shader
I'm using hardware tessellation to render a terrain mesh with variable LOD.
I have this snippet on my tessellation control shader:
int edge1 = gl_InvocationID;
int edge2 = (gl_InvocationID + 1) % 3;
tcs_out[gl_InvocationID].color =…
MadEqua
- 238
- 2
- 5
5
votes
2 answers
Blit and scroll
Could anyone please explain to me how drawing works with respect to scrolling?
Suppose there is a window, which has an area where one can draw to (a "canvas"). Are there two copies of this canvas? One for CPU and one for GPU? I mean, I know one…
Ecir Hana
- 1,459
- 11
- 20
5
votes
1 answer
Does light particle loses energy when it hits something?
I have some material which I want to represent as a collection of spheres (atoms) and a particle of light (photon). I'm firing this particle and checking for the collision against atoms. What should happen if collision occurs? I see two possible…
nikitablack
- 711
- 4
- 15
5
votes
2 answers
Is there any open code to get information about COLLADA or OBJ files?
I need a source code that takes as input a COLLADA file and/or an OBJ file, and gives as output basic information about the file, such as file size, model dimension, volume and if possible texture issues.
Pottercomuneo
- 153
- 3
5
votes
0 answers
Incorrect instanced rendering
Previously, to render a bunch of quads, I was simply using a few uniforms (one for a model matrix and another for the texture layer ID). However, I'd rather not have to loop through each quad and set both uniforms each time, each frame.
So I went…
Darkilon
- 91
- 8
5
votes
1 answer
glMultiDrawArraysIndirect does not work when specifying an offset
I'm trying to use glMultiDrawArraysIndirect to render a batch of object.
In my example I have a cube and a sphere (in this order) in a VBO and a GL_SHADER_STORAGE_BUFFER (SSBO) that contains matrix transforms as well as a GL_DRAW_INDIRECT_BUFFER…
Soapy
- 171
- 11
5
votes
1 answer
Dx12 Vertex Buffer incorrect
I'm playing around with directX 12 and I'm having some problems loading geometry in. I have a std::vector vertices definition and I do exactly what the dx12 template does with it.
const UINT vertexBufferSize = sizeof(vertices);
// Create the…
Andrew Wilson
- 828
- 7
- 15
5
votes
0 answers
CUDA cuMemcpuHtoD vs cuMemcpy2D
Asking it here and not on SO as it seems to be appropriate question for CG.
I am learning NVIDIA NVENC API.The SDK supplies a sampled called "NvEncoderCudaInterop" .There is a chunk of code which copies YUV plane arrays from CPU to GPU buffers.
This…
Michael IV
- 259
- 2
- 13
5
votes
1 answer
Convert RGB, Hex or any other color format to "Standard Color" Programmatically
Forgive me in advance for my ignorance.
Using the PHP function imagecolorat, I have a solution that presently delivers a set of the most dominant hex color codes available inside of an image.
Is there a known library that will allow me to then take…
David Lerner
- 153
- 1
- 5
5
votes
0 answers
How to extract a BRDF from a shader
For normalization purposes, how to "extract" a BRDF function from an ad-hoc piece of pixel shading code ?
If we have a shader function like:
float4 MyShadingFunction(float3 incomingLightDirection, float incomingRadiance)
{
float4…
wip
- 1,851
- 1
- 13
- 26
5
votes
1 answer
How can I get a spherical visibility mask map for a point on a concave surface?
I encountered this problem doing my project. Suppose there is a 3D mesh model, e.g. a human face, I need the 3D visibility map at each of the vertices of this model. By the "3D visibility map", I mean the binary image covering the spherical surface…
user1692
- 53
- 4
5
votes
0 answers
How to ignore rain or smaller objects movements in motion detection?
I first read Alan's answer about video noise removal which lead me to this question. I found later some algorithms ideas which capture motion in a similar way (frame comparison, as Alan described).
And then I found this "motion detection: fast and…
Armfoot
- 615
- 1
- 6
- 14