textures

C# OpenTK - Textured Quad

只谈情不闲聊 提交于 2019-12-19 04:49:29
问题 I've recently downloaded OpenTK. I've created a basic game class and a quad. I've tried rendering a texture in my quad but it doesn't work. Here's my code. This is the loading of the texture. (The texture class contains just an ID and a Bitmap. The GetWidth() and the GetHeight() just returns the Bitmap.Width and Bitmap.Height). Texture Texture = new Texture (); Texture.Bitmap = new Bitmap (Path); Texture.ID = GL.GenTexture (); GL.BindTexture (TextureTarget.Texture2D, Texture.ID); BitmapData

android textured text

北慕城南 提交于 2019-12-19 03:39:23
问题 How can I make a text with texture instead of text color or gradient(for example png file)? Something like this. I understand the logic, that I should make text color transparency and put under the text bitmap. I think I can't achive this with a Textview . And I don't know how to do it with a canvas or OpenGL. Any ideas please? 回答1: Here's a way of doing it using PorterDuffXfermode . public class MainActivity extends Activity { private EditText mEditText; private ImageView mImageView; private

glTexImage2D Segfault related to width/height

佐手、 提交于 2019-12-19 03:11:29
问题 I got a segfault when I tried to load a 771x768 image. Tried with a 24x24 and 768x768 image and they worked, no problem. Is this expected? Why wouldn't it just fail gracefully with a GL Error? The segmentation fault occurs in the glTexImage2D call. I am loading a PPM binary file so it is packed 24 bits per pixel. This odd number combined with an odd dimension probably produces a not-4-byte (or even 2-byte) aligned structure (and referencing outside of my exactly enough allocated buffer may be

How to create Stencil buffer with texture (Image) in OpenGL-ES 2.0

前提是你 提交于 2019-12-19 02:14:52
问题 Can I have Stencil prepared with a texture (Image) in OpenGL 2.0 So that some part of the Image will be transparent and as a result it will be transfered as is to Stencil buffer and then will use this use this stencil buffer for further drawing. EDIT by datenwolf to account for OPs question update in a answer: By @InfiniteLoop: @datenwolf thanks a lot for ur reply but no success :( here is my code - (void)render { [EAGLContext setCurrentContext:context]; glBindFramebuffer(GL_FRAMEBUFFER,

Loading a PNG image as a texture at runtime in Unity3d

杀马特。学长 韩版系。学妹 提交于 2019-12-18 21:28:48
问题 I'm using a series of PNG images as sprites to create animations on a plane for an augmented reality application in Unity. The PNG images are loaded as textures, and the textures are applied to a plane to create an animation sequence that tracks with an augmented reality target. Here is the script that is attached to the plane and controls the animation sequence. File PNGSequence.js #pragma strict var tecture : Texture[]; var changeInterval : float = 0.06; var isRunning = false; var isLooping

Loading a PNG image as a texture at runtime in Unity3d

杀马特。学长 韩版系。学妹 提交于 2019-12-18 21:27:11
问题 I'm using a series of PNG images as sprites to create animations on a plane for an augmented reality application in Unity. The PNG images are loaded as textures, and the textures are applied to a plane to create an animation sequence that tracks with an augmented reality target. Here is the script that is attached to the plane and controls the animation sequence. File PNGSequence.js #pragma strict var tecture : Texture[]; var changeInterval : float = 0.06; var isRunning = false; var isLooping

Exporting a simple model with texture from Blender to three.js

夙愿已清 提交于 2019-12-18 15:00:32
问题 Note: I want to avoid modifying the model in the javascript code and do all the model design inside Blender. Note #2: While this question is long, it is actually a basic problem (title says it all). The below is "walk-through" to the problem. I am trying export Blender models to threejs.org as DAE model but have problem with models with texture (I have tried JSON and OBJ+MTL format too): To make things simpler, here are the steps I perform (and fail) to add texture to simple "Startup file"

OpenGL texture atlas bleeding

依然范特西╮ 提交于 2019-12-18 13:36:01
问题 I'm trying to draw a basic 2d ground mesh made up of smaller tiles from a texture atlas (note the 1 pixel transparent border): I render the tiles as texture quads using the following code: glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, m_texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glVertexPointer(2, GL_SHORT

Simple OpenGL texture map not working?

我们两清 提交于 2019-12-18 13:29:40
问题 I'm trying to figure out texture mapping in OpenGL and I can't get a simple example to work. The polygon is being drawn, though it's not textured but just a solid color. Also the bitmap is being loaded correctly into sprite1[] as I was successfully using glDrawPixels up til now. I use glGenTextures to get my tex name, but I notice it doesn't change texName1; this GLuint is whatever I initialize it to, even after the call to glGenTextures... I have enabled GL_TEXTURE_2D. Heres the code: GLuint

libgdx: Rotate a texture when drawing it with spritebatch

早过忘川 提交于 2019-12-18 11:29:17
问题 Im trying to rotate textures when I draw them. I figured it would make more sense to do this than to rotate the images 90 degrees in paint.net and save them in different files. I looked thought the api documentation for spritebatch drawing arguments but I just dont understand. There are a bunch of arguments such as srcX, srcY, originX and so on. Also i would like to know how to do the same for texture regions. Heres a link to the api documentation page:http://libgdx.badlogicgames.com