In geometry a vertex is a point defining the corners of polygons or intersections of lines. A triangle for example is defined by 3 vertices with lines between them. In 3D-graphical APIs like OpenGL and Direct3D a vertex is a data structure containing information about the positions, normals, colors,...
1
vote
0answers
65 views
How to pass array of dozens of floats to OpenGL 3.0 vertex shader?
I use PyOpengl and Python 3.
I have 50 thousand vertices. Position of each vertex could be calculated in vertex shader as
#version 300 es
uniform v_coefficients_weights[COEFFICIENTS_AMOUNT];
in ...
0
votes
1answer
40 views
How are the positions of skinned mesh vertices with multiple weighted parents stored?
I'm trying to wrap my head around the basics of skinning and skeletal animation. I understand not every skeletal animation implementation works exactly the same, but I'm just trying to understand the ...
0
votes
1answer
80 views
Loading non-skeletal animation to opengl via assimp
I'm a newbie in assimp and openGL. I'm trying to import .fbx or .dae formatted file to openGL via assimp.
Importing skeletal animation was kind of easy. Lots of introductions and sample projects ...
1
vote
3answers
88 views
Process of writing to the depth texture
In openGL, let's say I output one single point from the vertex shader with this value
gl_Position = vec4(2.0,3.0,5.0,7.0);
what exact math operations happen to "z" after leaving the vertex shader?
...
2
votes
1answer
198 views
Point welding on generated terrain
I am converting two 2D images (A Voronoi graph and a Diamond Square noise map) into a 3D object.
However when finding the corner points of the Voronoi I am left with gaps, so I thought to drop these ...
1
vote
1answer
43 views
How do I make my indices anti-clockwise, so I can cull triangles in OpenGL? (immediate mode)
At the moment, I'm attempting a basic game engine in OpenGL using immediate mode. I'm trying to render a cube. Cube is a class with the vertices, normals, and indices. Here is part of the Cube class:
...
0
votes
0answers
29 views
How to prevent object from moving when it's mesh/collider is being updated?
So I a made a script that lets the player grab a vertex, move it, and then update the mesh. To help prevent the player from trying to clip it through other objects I made it so the mesh/collider is ...
1
vote
1answer
28 views
DirectX 11 Vertex Shader Fragmentation
I was wondering how my vertex shader is causing my cube to be render weirdly? I am using the Visual Studio graphics tool and see that my input assembler is correctly receiving the cube and I can only ...
0
votes
0answers
22 views
How to apply individual colours in a fragment shader?
I'm trying to write my own shader. Within the target mesh I have assigned the following attributes in a script:
mesh.vertices = points;
mesh.colors = colours; //Each element of the array hold a ...
1
vote
1answer
30 views
Mesh/Path reduction to simulate traveled path to target
I generate that kind of mesh during runtime to display the path to follow to a target (think at something like the path your GPS shows you when you are travelling):
I need to reduce the displayed ...
1
vote
0answers
49 views
indices for surface of revolution
I'd like to implement a surface of revolution.
I already implemented creating Vertices based on a 2D line.
I now want to get the indices to render the mesh with GL_TRIANGLES
Here's the code to ...
0
votes
0answers
35 views
How to get vectices of a sprite in correct order in Unity?
Currently, when I examine sprite.vertices, I see that it is ordered in crossed way, like: one from bottom, one from up, another one from somewhere else... etc.
I need the correct order to make array ...
0
votes
0answers
27 views
JAVA lwjgl 3D Quadmap engine help
I've been trying to make a custom generated level engine that creates a custom flat surface.
With my current knowledge of vertices and indices i have successfully created a rectangular surface.
My ...
3
votes
1answer
65 views
Vertex position problem for connected lines
I’m trying to generate a mesh to display connected segments representing street lines in a mini map. I have problem with vertex orientation that my math knowledge has hard time to resolve.
Let’s ...
0
votes
1answer
106 views
Avoiding GC when rebuilding Mesh.uv and Mesh.vertices
Since unity will not allow users to iterate over mesh.uv and mesh.vertices, I am stuck having to use GC intensive calls when applying an array of uvs and vertices to a mesh. I run into high GC ...
2
votes
1answer
156 views
Why doesn't Array.Copy to mesh.verticies work in Unity?
I am rebuilding a mesh but something seems odd that I have to create a temp array just to hold the verticies rather than copy an array.
I'm not using list because this is used frequently and I do not ...
2
votes
0answers
33 views
Weird warping with per-vertex normals
I've had this little problem for a while now, where for some reason my calculations for per-vertex normals results in a weird distortion or warping, skewing my lighting, shading, and reflection passes....
3
votes
2answers
131 views
Most efficient way to get the world position of the 8 vertexes of a Box Collider (C#)
What I am looking for is the most efficient way to get the world position of the 8 vertexes of the Box Collider of a freely rotated Gameobject. I cannot use collider.bounds since object is rotated, ...
1
vote
0answers
41 views
Detecting the two Vector3 that determine the bottom-edge of the side of a box-collider that had collision (with C#)
So, I understand that plenty of questions have been posted on how to detect which side of a Box Collider had collision. However, what I am trying to achieve is a little different.
I want to find out, ...
3
votes
2answers
139 views
Algorithm for triangle picking?
So i found out that i need a triangle picking algorithm, i need to see if my mouse is over the triangle.
I've heard what color picking is, but it would pretty much just drop the performance twice (...
0
votes
1answer
102 views
How to determine vertex index using Shader Model 3 or lower?
I need something like SV_VertexId (added in Shader Model 4) in HLSL shader to determine which vertex is currently handled. Unfortunatelly, I can compile only vs_3_0 or lower.
The objective is to ...
2
votes
1answer
88 views
OpenGL vertex data per index
Usually, vertex data is assigned to a particular vertex, like this:
[data] [vertices]
[1.31] -> [1, 13, 5]
[84.3] -> [5, 8, 12]
[.095] -> [8, 3, 10]
Then, you would typically have an ...
0
votes
1answer
393 views
Applying texture to a 3D object
I am trying to draw a 3D cube on the screen, using MonoGame. The cube was created in Blender and exported as an fbx file. The following is what the cube looks like in VS when opened in the editor:
...
0
votes
0answers
30 views
How to calculate per vertex normals? (OpenGL) [duplicate]
I am really confused and quite much thinking about how to do that? Cross product and then, normalizing is not working for me. Or perhaps, I take them all wrong. Well, please explain me that while ...
1
vote
2answers
91 views
Malformed/Pixelated Vertex Normals
I am trying to generate vertex normals for a given triangles/vertices list with the following code:
**BASE METHOD:**
private void CalculateNormals()
{
for (Int32 i = 0; i < m_Meshes.Count; ++...
1
vote
1answer
275 views
Vertex ordering with THREEjs's exporter
I'm using THREEjs's exporter to export a 2D polygon plane. The resulting JSON gives me the vertices. I'm trying to properly order these vertices as to make the actual polygon shape, without luck.
...
0
votes
0answers
36 views
Specify Vertex Quality in OBJ File
I've got a program that prints OBJ files in the format
# x y z r g b format opens with MeshLab only (http://meshlab.sourceforge.net/)
v xVal yVal zVal rVal gVal bVal
v xVal yVal zVal rVal gVal bVal
...
1
vote
1answer
135 views
Overlapping Vertex in DynamicVertexBuffer draw priority?
I am creating a voxel game, and I have recently run into an issue. My world is drawn by a DynamicVertexBuffer, which just consists of vertices for the blocks themselves. On top of that, I switch ...
7
votes
2answers
1k views
Geometry Shader not generating geometry for some Vertices
I am playing with a geometry shader and I am wondering why it doesn't generate geometry for each vertex in all meshes?
I don't think this is a Cull problem because the same vertices generate ...
0
votes
1answer
487 views
OpenGL ES 1.0 to OpenGL ES 2.0, I cant draw a square
I am learning open GL ES 2.0 and I just made 1 easy game for 1.0
I am following tutorials but I cant understand this thing
In OpenGL ES 1.0 if I define a square that way:
private float[] vertices = ...
0
votes
0answers
161 views
Invalid operation (1282) in GLSL vertex shader
My GLSL vertex shader works fine, but you if put a for loop inside or rename the uniform xxx to something else, it says the follwoing:
Exception in thread "main" org.lwjgl.opengl.OpenGLException: ...
2
votes
1answer
87 views
Good way to support multiple types of triangles? (C# XNA)
[this question is somewhat long. here's my question in a nutshell]
I want to use multiple types of Vertex data types for my triangle, interchangeably. So if I have a generic type T
private void ...
0
votes
0answers
216 views
What limits the number of vertices the GPU can process per clock cycle?
I am currently experimenting with OpenGL to make my own game. I wrote some test code to see what are the limits of my GPU. I own a Geforce 840m. This essentially consists of a draw command
...
0
votes
1answer
80 views
Normalizing a homogeneous 3d point
As I've seen corruption in geometry, why is it a bad idea to normalize a homogeneous (divide by w) the vertex position returned from vertex shader?
Update
Vertex shader:
// float4 pos : SV_POSITION;...
3
votes
1answer
557 views
Shader that draws just vertex points
The game I am developing is in unity and I want to make a shader which can be put on a mesh that only 'draws' color on each vertex point. I am not proficient with shaders, and out of all my searching ...
0
votes
1answer
119 views
Reasonable texture Formats for VertexTextureFetch in GL
Wich is a reasonable GL version that have support for vertex textures fetchs(VTF) in OpenGL ? (for example GL 3.0, 3.1, 3.3) What textures formats should I expect to be supported in average video ...
2
votes
1answer
133 views
How can I deal with vertex precision errors between terrain chunks?
I am using OpenGL to render the following scene, using vertex data from one of the map files of a popular MMORPG. The data is chunked and the pictured scene is made up of 256 (16x16) chunks.
However ...
0
votes
1answer
148 views
Making multiple VertexPositionColor variables in the same class? - XNA
I have studying XNA on my spare time for about a year now and I could use some professional help on this issue. Any time given to my problem is appreciated.
I have two VertexPositionColor variables ...
0
votes
1answer
288 views
Fragment Shader output type error
StackExchange!
I've been working with opengl for a bit and I'm trying to finally load the shaders instead of having them inline. I'm having a ton of issues, though. As soon as I solve one, another ...
0
votes
2answers
68 views
Setup VertexPositionTexture array for a texture2D at a location
I am trying to adjust the following code to render a quad on a 2D texture at a specific location and specific size. Currently this code will render a fullscreen quad, which makes sense since the ...
0
votes
2answers
178 views
How to write an adjacency algorithm that compares position data?
I have a list of indexed triangles for which I need to generate adjacency data. I've already written a brute force algorithm that creates 3 edge data structures for each triangle and then compares the ...
0
votes
1answer
52 views
What data to store along a vertex
Is there any other recommended data I should store in the vertex buffers aside from a vertex' coordinates, normals and texture coordinates?
For example data I'd need for a feature that almost every ...
1
vote
1answer
291 views
Vertex shader in OpenGL/GLSL - transformation of the interior of a textured quad
I have a LWJGL project and ran into a problem with a vertex shader I wrote.
In my scene I am rendering a map whose ground consists of rectangular tiles.
On top of that there are other objects (I used ...
5
votes
1answer
395 views
How do professional games avoid showing pixel seams in adjacent mesh boundaries due to decimal imprecision?
Graphics cards are mathematically imprecise.
So when some meshes are joined by their borders, the graphics card often makes mistakes and decides that some pixels at the seam represent neither object, ...
1
vote
2answers
237 views
Unity, shader, vertexID
I'm writing a shader and I just wanna ask if it's possible to get the ID of the vertex that is currently being manipulated. I read something about gl_vertexID, but I couldn't find out if that is ...
0
votes
0answers
18 views
Shader: vertex manipulation basics [duplicate]
I know this is a very noob question, but please bear with me I'm very new to graphics programming (I come from an iOS and web app development background).
When you modify the position of a vertex ...
1
vote
3answers
2k views
Why Does unity_LightPosition[0] Seem to Depend on Camera Position?
I'm trying to write a fairly basic shader but I keep running into lighting issues with Unity. My first problem was trying to figure out which variable stored the light's position in world space. (I'...
4
votes
2answers
614 views
How can I find the “end” vertices on an open-ended mesh?
I was looking at a video of a system that extrudes meshes along a curve, connecting them end to end but adjusting the vertices for a smooth connection. It does this with a mesh that as far as I know ...
4
votes
1answer
223 views
2D Boxes/Vertices merging
I want to optimize my colliders geometry, at the moment is composed by boxes (it's a tile based game) of the same dimensions, i want to remove the inner vertices to have, at the end, only the shell.
...
0
votes
1answer
98 views
Do I need to create an HLSL in XNA to display textures without content pipeline
I currently have a jpeg texture stored as a Color array in XNA as RGBA. I also have the vertices of a cube in OBJ format mapped to VertexPositionColor vertex buffer using the VertexBuffer and Indices ...