Most Popular

1500 questions
4
votes
1 answer

How to correctly implement Lambertian BRDF with point light

I'm implementing a simple Lamberitan BRDF in GLSL, using a point light source. My fragment shader simply returns light_colour * 1.0/PI * cosine, which should model a fully diffuse white material. However, it looks rather dark... If I have a point…
Supernormal
  • 500
  • 2
  • 9
4
votes
1 answer

Solving a set of Geometry Constraints - What's that Method called?

I am looking for the correct term for a type of problem solver. Since its hard to google for something without knowing its name, I hope that the good people of this stackexchange may be able to help me. When defining shapes in CAD systems based on…
4
votes
1 answer

How fast should I expect to render the silhouette of a 20k triangle model?

Using VTK 7.0 I have found that rendering a 20k triangle STL model takes approximately 17ms on my Nvidia GTX970. However, I am only interested in the silhouette of this model (like the image below) and was wondering if: a) such speeds are reasonable…
Tetao879
  • 41
  • 1
4
votes
2 answers

How to check which API's are available on a given machine?

I'm building an engine, which has Vulkan for its primary rendering engine. But to have at least some backwards compatibility with devices that don't have drivers for it (mainly mobile) I want to implement an OpenGL fallback. Now, how do I check what…
Aaro
  • 43
  • 7
4
votes
3 answers

OpenGL Vertex - Texture Mapping

I have a mesh loaded by an obj file (wavefront), complete with normals and texture coordinates per face, and its relative texture available. In my C++ / OpenGL code (assignment for a computer graphics class) I bind correctly the texture, but fail at…
phagio
  • 67
  • 6
4
votes
1 answer

How to use 32 bit Integers for Element Indices in WebGL 1.0?

WebGL 1.0 specification does not allow to create 32-bit index buffers. Now I'm in trouble, I'm trying to render huge objects with 100 thousands to 1 million indices. In OpenGL this is no issue at all, and I think it will be no issue in WebGL too, in…
q9f
  • 703
  • 2
  • 8
  • 22
4
votes
2 answers

How to encode/decode buffer data in glTF?

I'm playing around with base64 embedded data URI's and tried to analyze the buffer data of the gltf box sample model, as defined in this example here (line 76). "uri":…
q9f
  • 703
  • 2
  • 8
  • 22
4
votes
2 answers

Move position in smooth gradient

I am decrementing/incrementing position x until it reaches y. However, this creates a rectangular-like path. I want position x to smoothly curve towards y (diagonally) on a 2D plane. What kind of maths would I need to achieve this? Example image…
user4570
4
votes
1 answer

Compute shaders: one-time-only versus persistent buffers

When using a Compute Shader, is it possible to keep a buffer in the GPU memory during the whole run-time duration of the application, so whenever the original Compute Shader or other Compute Shaders are executed later they can access data from such…
4
votes
2 answers

Implement own Bend function

I'm trying to write a mesh deformer that bends a Cube around an axis like this: The bend degree in figure A is 90 and something like 35 in B. So if I know my desired bend degree how can I get alpha? I know that the distance between the vertices v1…
lega
  • 57
  • 4
4
votes
0 answers

View Reference Coordinate System

For a 3D scene in the World Coordinates, its View Reference Point is at c=(0,3,4), and a viewer is looking towards its origin O (0,0,0). Construct a transform matrix which will map World Coordinate points to a right-handed (UVN) viewing space, so…
TheRapture87
  • 181
  • 2
4
votes
1 answer

Is there a way for me to record every shading sample for a deep texture

Im developing a deep texture processing engine. Right now I have a software renderer to generate the raster samples. Now, for bigger renders it would be nice to do this on hardware. Is there a standard mechanism on how to capture the data of each…
joojaa
  • 8,437
  • 1
  • 24
  • 47
4
votes
1 answer

Why is the color in the cube being weirdly swapped?

I am implementing a trackball, i.e. a camera orbiting about a fixed point, in my case the origin. When I do left click with the mouse and start moving it, I compute delta values for the angles of a sphere centered at the origin given the…
BRabbit27
  • 969
  • 1
  • 10
  • 21
4
votes
0 answers

OpenGL ES vertex/fragment shaders - Blinn phong

I'm developing a simple educational project to study OpenGL ES. I'm try to render some simple OBJ models using Blinn-Phong. The first version of the of my implementation calculate all the lighting equation in this way: #version 300 es struct…
Fabrizio Duroni
  • 537
  • 4
  • 13
4
votes
1 answer

GPU short circuit when multiply by 0?

So I am trying to make my shader efficient by lowing the amount of texture lookups. If I had a line of code with something like. step(1.0, x) * texture2D(pic1, uv); Where x is a value that ranges from 0 to 2 based on the fragment position. Would…
J.Doe
  • 1,445
  • 12
  • 23