Questions tagged [vertex-attributes]

73 questions
1
vote
1 answer

Display additional information on vertex of a graph

I have an oriented graph, using the following example ba <- sample_pa(n=100, power=1, m=1, directed=T) V(ba)$color<-"yellow" tkplot(ba , layout=layout.fruchterman.reingold(ba), canvas.width=1024,canvas.height=768) I would like to find the way to…
A. F.
  • 13
  • 3
1
vote
1 answer

Open GL Shader Storage Buffer Objects to replace Vertex Attributes

I basically got the same question as the guy who asked here: Dynamically sized arrays in OpenGL ES vertex shader; used for blend shapes/morph targets . Especially his last unanswered question bothers me too. So I also want to use an arbitrary…
1
vote
0 answers

OpenGL instancing: using mat4x2 or vec2[4]

Follow examples online, here is the code in the vertex shader: The attributes are defined as follows: // Option 1: layout (location = 0) in vec3 colorvec3; layout (location = 1) in mat4x2 xyInBaseImageMat4x2; out vec2 xyInElementTextureImage; out…
user1914692
  • 3,033
  • 5
  • 36
  • 61
1
vote
2 answers

Vertex attributes - using short instead of float for vertex positions

Currently I have following setup which is working fine for far. struct Vertex { glm::vec3 position; glm::vec3 normal; glm::vec2 texCoord; } std::vector vertices; The…
Mr. X
  • 41
  • 6
1
vote
1 answer

Rendering to texture and attribute location

I am using webgl and what I want to do is first render to a texture, then use that texture to render on screen, and I encounter a problem with an attribute in the first step render. I will try to explain in a few words what I am trying to do. First…
khael
  • 2,600
  • 1
  • 15
  • 36
1
vote
1 answer

Display labels for desired vertices only

I only want to show labels for the vertices that have a degree greater than 50. I've tried the following code : plot(g, vertex.label=(V(g)$id[which(degree > 50)])) But rather than only labeling the desired vertices, it seems to relabel all vertices…
user4100980
  • 127
  • 1
  • 1
  • 13
1
vote
1 answer

Padding vertex structure manually to achieve allignment

When passing vertex data to your shaders, is it wise to apply padding to your vertex structure to achieve allignment (16byte) or is that something that the hardware is performing anyway? For example are these two vertex structures equally…
SvinSimpe
  • 850
  • 1
  • 12
  • 28
1
vote
1 answer

Assigning graph attributes using a function in R using switch()

I have a follow up question to the one I asked here. I want to build a function that will assign attributes to a graph based on a certain parameter (called lev in the example below). Here is my toy graph: toy.graph <-…
Justyna
  • 737
  • 2
  • 10
  • 25
1
vote
1 answer

three.js maintaining creases when smooth shading custom geometry

I created a custom mesh by adding vertices and faces to a new THREE.Geometry(), then running computeFaceNormals() and computeVertexNormals() on it to smooth out the rendering (I'm using the MeshPhongMaterial). Without computevertexnormals, parts of…
Chris Chalmers
  • 574
  • 4
  • 13
1
vote
1 answer

glVertexAttribPointer GL_INVALID_OPERATION invalid vao vbo pointer usage

I am trying to implement deferred shading with OpenGL 4.4 on a NVIDIA GTX 970 with latest drivers installed.My code worked with rendering directly to screen. To add a second pass, I create a FBO to which I render my scene and a quad to which I…
Maru
  • 894
  • 1
  • 12
  • 29
1
vote
1 answer

WebGL - which API to use?

I want to draw multiple polygon shapes (where each shape has it's own set of vertices). I want to be able to position these shapes independently of each other. Which API can i use to set the a_Position for the vertex shader? A) gl.vertexAttrib3f B)…
AlvinfromDiaspar
  • 6,611
  • 13
  • 75
  • 140
1
vote
1 answer

Haskell opengl attrib is not active

I am trying to render some data from a vertex buffer object. However with little using glutil and raw. When the program runs it is stuck in a infinite loop and I get the errors that you see down below. vertex shader #version 150 core in vec4…
1
vote
2 answers

in openGL how do i edit a specific vertex buffer attribute from memory

if my vertex data was layed out example: struct Vertex { float position[4]; float normal[3]; float texCoord[2]; } i know we use glBindBufferARB( GL_ARRAY_BUFFER_ARB, m_uiVertBufferHandle ); //get the pointer position where we can…
1
vote
1 answer

Understanding opengl instanced arrays

given std::vector cubeIndices; struct FaceGroup { unsigned int face_index; unsigned int start_index; size_t length; // comparison operators omitted }; std::set::iterator i; GLuint attribIndex; I was rendering each…
larvyde
  • 811
  • 1
  • 6
  • 19
1
vote
1 answer

How is index data handled in glDrawElements?

I know that when glDrawElements is called it uses a buffer of indices to determine what vertices to draw in what order. My question is how those indices are applied to texture, normal, and color attributes. Is it possible to set another index array…
dagronlund
  • 1,612
  • 3
  • 13
  • 15