vertex

Vertex Shader Creating

别等时光非礼了梦想. 提交于 2019-12-12 01:37:07
问题 I am learning D3D and currently i am at shaders. I wrote the code and built it - succeed but when debug i get this error: ERROR Here is the line where debugger breake: dev->CreateVertexShader(VS->GetBufferPointer(), VS->GetBufferSize(), NULL, &pVS); And here is the whole function: void InitPipeline() { // load and compile the two shaders ID3D10Blob *VS, *PS; D3DX11CompileFromFile("Shaders.shader", 0, 0, "VShader", "vs_4_0", 0, 0, 0, &VS, 0, 0); D3DX11CompileFromFile("Shaders.shader", 0, 0,

Strange error in GLSL while assigning attribute to a varying in vertex shader

泪湿孤枕 提交于 2019-12-11 13:53:21
问题 I am writing a GLSL program for texture mapping. I am having a weird problem. From my vertex shader I am trying to pass the texture coordinate vec2 as a varying to frag shader. In a diff shader in the same prog I did the same and it worked. But for this texture its not working. If I comment that line, then everything works. I have no clue why this is happening. This is the vertex shader: attribute vec4 position; attribute vec4 color1; attribute vec4 normal; attribute vec2 texCoord; uniform

Processing, using texture inside the audio waveform

北城余情 提交于 2019-12-11 10:48:05
问题 I've been trying to make the texture ( the img ) to be visible only where wave form active is. But so far my attempts failed. I didn't quite understand the usage of vertex. PImage img; import ddf.minim.*; Minim minim; AudioPlayer song; void setup() { size(800, 600,P2D); minim = new Minim(this); song = minim.loadFile("song.mp3"); song.play(); img = loadImage("img.jpg"); } void draw() { background(0); stroke(255); for (int i = 0; i < song.bufferSize() - 1; i++) { beginShape(); texture(img);

JUNG: unpicked vertex label color

情到浓时终转凉″ 提交于 2019-12-11 03:54:14
问题 I can make picked vertex labels red using vertexLabelRenderer declared like this: DefaultVertexLabelRenderer vertexLabelRenderer=new DefaultVertexLabelRenderer(Color.RED); How do I change color of unpicked vertex labels. Constructor (see below) only allows defining unpicked vertex labels. Also method setForeground() does not affect the font color. Here is the JUNG 2.0.1 API document: http://jung.sourceforge.net/site/apidocs/edu/uci/ics/jung/visualization/renderers/DefaultVertexLabelRenderer

Direct3D multiple vertex buffers, non interleaved elements

吃可爱长大的小学妹 提交于 2019-12-11 01:29:44
问题 I'm trying to create 2 vertex buffers, one that only stores positions and another that only stores colors. This is just an exercise from Frank Luna's book to become familiar with vertex description, layouts and buffer options. The problem is that I feel like I have made all the relevant changes and although I am getting the geometry to show, the color buffer is not working. To complete the exercise, instead of using the book's Vertex vertices[]={{...},{...},...} from the example code where

How to add faces to THREE.BufferGeometry?

北战南征 提交于 2019-12-10 23:43:00
问题 I have created programmatically a simple mesh: var CreateSimpleMesh = new function () { var xy = [], maxX = 7, maxY = 10, river = [[0, 5], [0, 4], [1, 3], [2, 2], [3, 2], [4, 1], [5, 1], [6, 0]], grassGeometry = new THREE.BufferGeometry(), grassVertexPositions = [] this.init = function () { for (i = 0; i < maxX; i++) { for (j = 0; j < maxY; j++) { xy.push([i, j]) } } for (var i = 0; i < xy.length; i++) { grassVertexPositions.push([xy[i][0], xy[i][1], 0]) grassVertexPositions.push([xy[i][0] +

OpenGL ES 2.0 with iPhone: GL_POINT_SMOOTH draws squares with ES 2.0 but works in ES 1.0

帅比萌擦擦* 提交于 2019-12-10 19:01:25
问题 I'm trying to draw circles by using a Vertex Buffer Object to draw points with GL_POINT_SMOOTH enabled in OpenGL ES 2.0 on iPhone. I've used the following ES 1.0 rendering code to draw circles successfully on iPhone 4: glVertexPointer(2, GL_FLOAT, 0, circleVertices); glEnableClientState(GL_VERTEX_ARRAY); glEnable(GL_POINT_SMOOTH); glPointSize(radius*2); glDrawArrays(GL_POINTS, 0, 1); I'm now trying to achieve the same effect using a set-up VBO followed by this ES 2.0 rendering code: glEnable

Max size for Vertex Buffer Objects (OpenGL ES 2.0)

爱⌒轻易说出口 提交于 2019-12-09 05:45:15
问题 Is there a max size for vertex buffer objects binded to GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER??? Originally, I was drawing a mesh composed of 16 submeshes. For each submesh, I created a vertex buffer and during the rendering phase, I called glDrawElements. This worked fine on the iOS simulator, but when I tried to render to my device, the screen flashes constantly and the meshes aren't displayed. I then did some reading and found that you shouldn't call glDrawElements too many times

Android opengl modify vertex array after draw call

假如想象 提交于 2019-12-06 13:20:58
In opengl, is it bad practice or not recommended to modify the vertex array after I have drawn it? It's not bad practice if you modify the vertex array when you draw it as ordinary vertex array. It's bad practice to modify the vertex array if you use vertex buffer objects in your draw method. That's because you have to reupload it to your VRAM once it is edited. 来源: https://stackoverflow.com/questions/4703550/android-opengl-modify-vertex-array-after-draw-call

Spherical Voronoi Tessellation with Java 7: need fix for winding vertices around faces

只谈情不闲聊 提交于 2019-12-06 11:04:24
I am working on a problem that involves finding the Voronoi tessellation for points distributed over the surface of a sphere. As far as I can tell, my brute-force approach works, since visually it seems to find the Delaunay triangulation of the points. However, my algorithm seems to fail when defining each face's edge order using the vertices. As an example of what I'm going for, here is a picture of a version that correctly determines the edges using a hack that determines edges by determining whether two vertices share more than one forming point. Note that I want to use the tessellation to