Tag Info

Hot answers tagged

4

Well, OpenGL is a state machine, so inorder to plot function dependencies you need to plot a state machine, there is this one that models the most recent versions of OpenGL pipeline including ES2.0 and 4.0. Unfortuantely I couldn't find a diagram the plots function dependencies but I guess that can be mostly deduced from the state machine.


3

Even when you have hundreds of objects to draw, typically those are many copies of the same object. E.g., you might a stack of 10 crates, or two goblins, or a hundred trees. You only need to store this identical data once. You'd then have a structure similar to: struct Material { Shader shader; vector<Texture> textures; UniformMap parameters; }; ...


2

You can use your texture coordinates, and set a uniform that tells you the aspect ratio of your rect, and the desired width of your border. Then, you can just check to see if your pixel falls within the bounds of your rectangle. (0, 0) (1, 0) ------------------------------------- | (0.1, 0.1) Border (0.9, 0.1) | | ...


2

Generally speaking, you will need a separate draw call for each set of objects that have a different material (by material I mean a different shader, texture or other shading parameters). So the obvious approach is to group objects that have the same material, so that they can be rendered together, avoiding the expensive state changes. This is normally done ...


1

Solution 1: Texture Atlas where you can tweak the UV coords in your mesh to specify a subsection of the texture to use for a portion of your map. This solution requires that each "tile" of the map be a separate quad so you can control the UV coords of each corner... sharing verticies at the corners of a tile will not work right. Solution 2: if you are doing ...


1

You probably would want to do it like this: Have a VBO (+index buffer) for each mesh in the scene (a mesh is just the collection of vertices and indices). Have your objects separately hold a reference to their meshes and store their transformation. From there you can have multiple objects referencing the same mesh with different transformations which is ...


1

I think that it is impossible to solve your problem just by using a pair of tricky fragment and vertex shaders. That is why: You select a set of UV points in 2D space. Then, using the function you have defined, you can get another "linked" set of UV points. But you still have to get somehow 3D coordinates from the surface UV coordinates. So your problem can ...


1

"Is this approach even possible?" What you could do is make a fine resolution full screen "quad" that has it's verticies displaced in the vertex shader according to a lookup into your "depth buffer" texture. That way, the perceived depth of your grayscale image will be written into the currently bound framebuffers depth buffer. "I want to write a shader ...



Only top voted, non community-wiki answers of a minimum length are eligible