textures

SDL OpenGL Rendering Issue

╄→гoц情女王★ 提交于 2019-12-11 02:13:51
问题 I am just learning how to use SDL and openGL. I've been through the tutorials over at SDLTutorials.com. I am now trying to take things further and create a loading screen for an application; an oop menu system. I am starting off real simple to test things out. I have the main backdrop of the window done via a texture class. The two relevant functions are defined here: void Texture::Bind() { glBindTexture(GL_TEXTURE_2D, TextureID); } void Texture::RenderQuad(int X, int Y, int Width, int Height

Fill texture brush using image, not tile

时光总嘲笑我的痴心妄想 提交于 2019-12-11 02:03:24
问题 I have a texture brush that uses a certain image to make the texture to be displayed like this: Image image = new Bitmap("Untitled.png"); for (int i = 0; i < points.Count; i++) { using (TextureBrush tbr = new TextureBrush(image)) { tbr.RotateTransform(i * 4); var p = PointToClient(Cursor.Position); tbr.Transform = new Matrix( 75.0f / 640.0f, 0.0f, 0.0f, 75.0f / 480.0f, 0.0f, 0.0f); e.Graphics.FillEllipse(tbr, p.X - 50, p.Y - 50, 100, 100); Pen p3 = new Pen(tbr); e.Graphics.DrawEllipse(Pens

iPhone OpenGL ES texture unit

五迷三道 提交于 2019-12-11 01:57:28
问题 I am new to writing OpenGL ES for the iPhone. I am trying to render yuv texture, but am very confused by the concept of a texture unit. If I change the glUniform1i's second parameter with different combination, the resulting image is different. My question is how is this 0 or 1 texture unit configured? What is the right way of using it? Edit: Stupid me... forgot to call this: glTexParameteri(GL_TEXTURE_2D, GL_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_MAG_FILTER, GL_NEAREST);

How can I preload textures with Three.js?

孤人 提交于 2019-12-11 01:36:42
问题 I am using THREE.TextureLoader() to preload the textures, but I can't seem to assign them to my shaders. var textureLoader = new THREE.TextureLoader(); textureLoader.load('img/texture.jpg', function(){ assetsLoadedCount++; }); In another function, I check assetsLoaded to initialize my scene: if(assetsLoadedCount == totalAssetsCount) { // Create a sphere: var sphere = new THREE.Mesh( new THREE.SphereGeometry(100, 10, 10), new THREE.MeshBasicMaterial({ map: textureLoader }) ); scene.add(sphere)

Cannot render to texture with multisampling

南楼画角 提交于 2019-12-11 01:23:53
问题 I ran the framebuffers example in this page -original code- (using glfw3 and glew in xcode 4.6 in osx 10.8), it worked fine, then I wanted to add multisampling (to avoid jagged edges on cube edges and on the floor, glfwWindowHint (GLFW_SAMPLES, 4) was enough when rendering directly to the back-buffer), found some answers directing to opengl.org, tried to use glTexImage2DMultisample but it displayed nothing (black screen). The framebuffer settings and rendering loop is: // Create frame buffer

WebGL2 — How to store and retrieve 3D texture data needed by 3D grid of vertices to calculate new vertex positions

不问归期 提交于 2019-12-11 01:03:50
问题 3D Physics simulation needs access to neighbor vertices' positions and attributes in shader to calculate a vertex's new position. 2D version works but am having trouble porting solution to 3D. Flip-Flopping two 3D textures seems right, inputting sets of x,y and z coordinates for one texture, and getting vec4s which contains position-velocity-acceleration data of neighboring points to use to calculate new positions and velocities for each vertex. The 2D version uses 1 draw call with a

How to load and fill cubes with texture image in openGL

陌路散爱 提交于 2019-12-11 00:48:15
问题 I have a grid with cubes and i want to fill the cubes with two different colors and with 3 different images(.bmp). So every cube is filled with colours or images. I wrote a code and when i press the <> button the grid is filled with 5 different colours. Can anyone tell me how can i change my code to fill the grid with 3 different images(randomly)? Here is my code: void randomFilling(); void myprint(); struct square{ int v1x, v1y; int v2x, v2y; int v3x, v3y; int v4x, v4y; int color; }; struct

iOS background and images seem to not scale properly for retina display

拥有回忆 提交于 2019-12-11 00:35:51
问题 When using the following code: self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"texture1.png"]]; The texture background of my view gets set just fine. But I can see that the images are not scaled properly for a retina display, they seem more pixelated, rather than rich in texture and color as they should be. I have had this issue with other images too, when trying to make an image the size of the iphone 5 screen fade away, only a part of it would be seen

Transferring textures across adapters in DirectX 11

大兔子大兔子 提交于 2019-12-10 20:54:13
问题 I'm capturing the desktop with the Desktop Duplication API from one GPU and need to copy the texture (which is in GPU memory) to another GPU. To do this I have a capture thread that acquires the desktop image then copies it to a staging resource (created on the same device) using ID3D11DeviceContext::CopyResource. I then map that staging resource with Read, map the destination dynamic resource (which was created on the other device) with WriteDiscard and copy the data. On the rendering thread

OpenGL ES texture mapping

て烟熏妆下的殇ゞ 提交于 2019-12-10 20:24:50
问题 I need to draw circles in my Android application. Actually it is a Pacman game and I need to draw tablets. Since there are many tablets on field I decided to draw each tablet with a single polygon. Here is the illustration of my idea: http://www.advancedigital.ru/ideal_circle_with_only_one_polygon.jpg Vertex coordrs: // (x, y) 0 : -R, R * (Math.sqrt(2) + 1) 1 : -R, -R 2 : R * (Math.sqrt(2) + 1), -R Vertex coords are calculated relative to circle center to place circles with ease later. The