Все вопросы: [textures]

110 вопросов

0
голосов
1ответов
552 просмотров

Как с помощью opengl совместить фоновое изображение и искаженную текстуру меньшего размера?

Я пытаюсь сделать на iphone эффект растягивания изображения. Я создаю массив вершин и сдвигаю данные текстуры для каждого индекса в пределах произвольного радиуса фонового изображения. Затем выполните следующие вызовы для отображения: int n = gridSize_.x * gridSize_.y; glEnableClientState( GL...

4
голосов
1ответов
8174 просмотров

Как вы обрабатываете несколько текстур в индексированном буферном массиве OpenGL для использования с шейдером данных?

Я пытаюсь реализовать этот документ . У меня большая часть этого не работает, но часть об отправке произвольных, не геометрических данных в шейдер для использования при определении и отображении геометрических краев вызывает у меня проблемы. Мне удалось успешно отправить большую часть моих данн...

1
голосов
3ответов
1257 просмотров

OpenGL ES.Прокрутка трехслойных текстур звездного поля дает мне от 60 до 40 кадров в секунду.

Мне нужно нарисовать фон для 2D-шутера с прокруткой пространства. Мне нужно реализовать 3 слоя звезд: одна далекая туманность (движется очень медленно) на заднем плане, один слой далеких звезд (движется медленно) и один слой близких звезд (движется нормально) поверх двух других. Я впервые поп...

0
голосов
3ответов
1635 просмотров

OpenGL - текстуры загружаются неправильно

ОБНОВЛЕНИЕ: Я разместил код средства визуализации ниже, поскольку этот код здесь не является проблемой. У меня проблема с некоторым моим кодом, когда, когда я пытаюсь загрузить несколько текстур в openGL, по одной, это довольно впечатляюще не работает, так как средство визуализации в конеч...

3
голосов
4ответов
3776 просмотров

Sharing a texture between direct3d and opengl?

I know mixing OpenGL and DirectX is not recommended but I'm trying to build a bridge between two different applications that use separate graphics API:s and I'm hoping there is a technique for sharing data, specifically textures. I have a texture that is created in Direct3D like this: d3_device...

2
голосов
2ответов
444 просмотров

32 pixel gap at top of opengl es texture

I am trying to render to a texture using openGL ES (for iPhone) and then display the texture on the screen. Everything works except that there is a 32 row gap at the top of the texture and the bottom 32 rows are cut off. It's like all of my drawing is being offset 32 pixels down, which results in...

6
голосов
2ответов
7274 просмотров

How to programmatically alpha fade a textured object in OpenGL ES 1.1 (iPhone)

I've been using OpenGL ES 1.1 on the iPhone for 10 months, and in that time there is one seemingly simple task I have been unable to do: programmatically fade a textured object. To keep it simple: how can I alpha fade, under code control, a simple 2D triangle that has a texture (with alpha) appli...

0
голосов
1ответов
513 просмотров

What does SetPrivateData does in Managed DirectX?

Iv'e seen this method for a Texture, would someone explain me what does it do?

1
голосов
1ответов
397 просмотров

How do I set a pixel color in a texture using ManagedDX?

Hey guys, I need to set a specific pixel in a texture to a custom color, for doing that I made a Bitmap and I always set the pixel in the bitmap, then I recreate the texture from the bitmap. Doing that is very time consuming, is there any way to modify the pixel directly in the texture?

2
голосов
1ответов
370 просмотров

Algorithm for "filling in" texture in a 2D image

I recall seeing a paper a while back for an algorithm that could automatically and seamlessly "graft" texture from parts of an image onto another part of an image. The approach was something along the lines of the following: You'd build up a databases of small squares of pixels (perhaps 8X8) fr...

4
голосов
3ответов
2607 просмотров

Texturing error on a Sphere

I have a number of spherical longitude/latitude coordinates for points on a sphere that I need to visualize. For that purpose, I transformed the points to cartesian coordinates and built a mesh of triangles that I can render with VTK. Works so far. Now I want to use a texture for the sphere mode...

5
голосов
2ответов
480 просмотров

Link to external texture file in self-contained XAML representing a 3D model

I have a XAML file representing a 3D model with textures. I want to make the textures read from the same place the file is, or relative to it. I read the file using a XamlReader, so I want the file to be self-contained. I place the textures using an ImageBrush which ImageSource is a pack synat...

0
голосов
2ответов
1976 просмотров

Dynamic texture loading in SDL

I´ve got problems with opening textures in SDL. I´ve got a function to read bmp files, optimize them and add colorkey: SDL_Surface* SDLStuff::LoadImage( char* FileName ) { printf( "Loading texture: \"%s\"\n", FileName ); SDL_Surface* loadedImage = 0; SDL_Surface* optimizedImage = 0; loadedImag...

4
голосов
2ответов
6140 просмотров

I thought *.DDS files were meant to be quick to load?

Ok, so I'm trying to weigh up the pro's and con's of using various different texture compression techniques. I spend 99.999% of my time coding 2D sprite games for Windows machines using DirectX. So far I have looked at texture packing (SpriteSheets) with alpha-trimming and that seems like a dece...

5
голосов
1ответов
3904 просмотров

Is there any point in using an index buffer with a texture in OpenGL ES (Android)?

I'm using OpenGL ES to display some objects exported from Blender. Blender provides a list of vertices, a list of the face indices and a list of the 2d texture co-ordinates. Within Blender, and I believe generally in OpenGL, the texture co-ordinates map to each vertex described in the index arr...

0
голосов
3ответов
2247 просмотров

OpenGL Texture Combiner - gradient texture

I've got 2 RGBA8 textures: A) The "main" texture with data for display in all channels B) The "gradient" texture that only has meaningful data in alpha (of course this should really just be an A8 texture) Using OpenGLES 1.1 texture combiners, I'd like the resulting texel to copy RGB from textu...

3
голосов
2ответов
6769 просмотров

Basic 2D Texture Howto for iPhone OpenGL ES

Just started learning OpenGL and couldn't find a decent tutorial to get me going. Specifically, I'm looking for something that will show me how to load an image to an OpenGL texture, store it in a variable to display later, and then draw the image. I'd appreciate it if someone could write out th...

0
голосов
1ответов
242 просмотров

Enabling transparency on a texture in O3D

I have a texture of a set of lungs and the heart that I am applying to a series of triangles. The texture is a .png file and has a transparent background but when I apply it in O3D it shows up with a white background. How would I get this to show up as transparent?

1
голосов
2ответов
1902 просмотров

Is it possible to check whether an OpenGL ES texture on iPhone has been truly deallocated?

The manual just instructed you to write: glDeleteTextures(1, &GLtexture); and claims that the texture will be deleted. iPhone has scarce memory and I want to ensure that these textures are truly released. The Leaks instrument cannot detect this, and frankly, I am a bit worried. I do real...

0
голосов
1ответов
812 просмотров

Program crashes when releases UIImage after generating OpenGL ES texture

Right now, I have followed this tutorial: http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-part-6_25.html It does not work if I tried to release UIImage: I will get a 'EXC_BAD_ACCESS'. Now, I made the UIImage to be instance variables and retain them. I do not make it autor...

1
голосов
1ответов
2972 просмотров

Draw polygon to clip texture to be transparent where polygon is in OpenGL ES

I have two layers being drawn. A static background texture and a texture(png) with transparent parts. I can correctly see the background with no problems. What I would like to do is modify the top layer by drawing a polygon(rectangle) with size that will change at run time to make that portion of...

1
голосов
2ответов
598 просмотров

Which version of OpenGL supports rectangular textures (w/o extensions)?

Rectangular textures used to be support through extensions and at some version of OpenGL are now directly supported, i.e I can create textures with the same basic opengl methods just supplying non-power-of-two sizes. I've googled and can't seem to find a definitive changelog for the OpenGL spec....

3
голосов
3ответов
2955 просмотров

How to get a C method to accept UIImage parameter?

I am trying to do some Image processing on a UIImage using some EAGLView code from the GLImageProcessing sample from Apple. The sample code is configured to perform processing to a pre-installed image (Image.png). I am trying to modify the code so that it will accept a UIImage (or at least CGImag...

1
голосов
3ответов
1936 просмотров

Altering brigthness on OpenGL texture

I would like to increase the brightness on a texture used in OpenGL rendering. Such as making it bright red or white. This is a 2D rendering environment, where every sprite is mapped as a texture to an OpenGL polygon. I know little to nothing on manipulating data, and my engine works with a textu...

2
голосов
3ответов
819 просмотров

OpenGL: distorted textures when not divisible by 2

I have a game engine that uses OpenGL for display. I coded a small menu for it, and then I noticed something odd after rendering the text. http://img43.imageshack.us/i/garbagen.png/ As you see, the font is somewhat unreadable, but the lower parts (like "Tests") look as intended. Seems the positi...

4
голосов
4ответов
4973 просмотров

Tiling Simplex Noise?

I've been interested (as a hobbyist) in pseudo-random noise generation, specifically the Perlin and Simplex algorithms. The advantage to Simplex is speed (especially at higher dimensions), but Perlin can be tiled relatively easily. I was wondering if anyone was aware of a tiling simplex algorithm...

2
голосов
5ответов
2229 просмотров

render transparent textures

I have one texture that has some portions which are transparent transparent I want to apply over an object whose faces are some opaque material (or colour if it's simpler) but the final object gets transparent. I want the final object to be totally opaque. Here is my code: First I set the mater...

2
голосов
1ответов
2869 просмотров

Removing OpenGL texture artifacts

I am creating a simple opengl application which obviously includes some 3d-objects and textures. My problem is however that artifacts appear on every texture. These come in the form of triangles along the edges. I have noticed that it disappears as soon as I move the view-point closer to textur...

0
голосов
4ответов
300 просмотров

Huge area texture?

This is a very general question that's not related to a specific language. I'm having this array of int's: int[100][100] map; This contains just tile numbers, and is rendered as 256x256 tiles. So it's basically just a tile map or whatever it should be called. Thing is I want to be able to writ...

2
голосов
1ответов
4613 просмотров

iPhone OpenGL ES Texture2D Masking

What's the best choice when trying to mask a texture like ColorSplash or other apps like iSteam, etc? I started learning OPENGL ES like... 4 days ago (I'm a total rookie) and tried the following approach: 1) I created a colored texture2D, a grayscale version of the first texture and a third tex...