texture

Matrix to Represent a Triangle in Screen Space

Hi All, So i have a set of four points in 3D Space. P1 [0, 0, 0] P2 [128, 0, 0] P3 [0, 128, 0] P4 [128, 128, 0] Which I'm then projecting orthographically to the screen effectively giving me two wireframe triangles in screen space. I now want to map a texture to this "plane" comprised of the two triangles. So i take my square...

How many 1024*1024 pngs can be load in openGL for iphone without having the app crash in the device ? ?

Approximately what's the maximum number of 1024x1024 32 bit .pngs which can be loaded at the same time with openGL in iphone ?, without risk of the app crashing. And .pvr ? a much higher number ? If I need a huge amount of textures in my game, is healthy to keep loading and calling dealloc to not overload the memory with all the text...

Floating Point Textures in OpenGL ES 2.0

I've been trying to figure out how to use float textures in GLES2. The API Reference (http://www.khronos.org/opengles/sdk/docs/man/glTexImage2D.xml) says that only unsigned bytes and shorts can be used, but i've seen people saying it is supported elsewhere. I could use GL_LUMINANCE as the texture format but that only gets me one float v...

Reading 32-bit RGBA float values in GLSL

I'm trying send some 32 bit float data to a shader, but the results are erratic. If I test with full white (1,1,1,1) the values are all zero. This is my code for creating the texture: gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA32F_ARB, 512, 512, 0, GL.GL_RGBA, GL.GL_FLOAT, data); and reading from it in GLSL: uniform sampler2D u_t...

OpenGL ES multi-texture alpha blending question

This maybe a noob question, however, I haven't been able to find a suitable answers: I have an object in OpenGL ES (in fact, an UV mapped export from Blender) and I'd like to apply two textures to it. To be precise, I have a earth-like sphere and I would like to add two textures (a day-side and a night-side) to it. I had thought throug...

OpenCL Texture Memory

I'm fairly new to OpenCL so please bear with me. In the first iteration of my code, I used basic memory buffers for large datasets and declared them global. However now that I'm looking to improve the timing, I wanted to use texture memory for this. In the CUDA version, we use cudaBindTexture and tex1Dfetch to obtain the data for a larg...

How to clip the texture in rounded shape

I need to display texture of image with the rounded shape,my code as follow texture = Texture.FromBitmap(device,myBitmap, Usage.RenderTarget, Pool.Default); _sprite.Begin(SpriteFlags.SortTexture | SpriteFlags.DoNotModifyRenderState); _sprite.Draw(_allocator.Texture, Vector3.Empty, new Vector3(_objectLocation.X, _objectLocation...

Texture onto 3D car mesh

I have a 3D car mesh object. How can I reflect a 3D text onto the 3D mesh surface? I'm using Visual Studio 2008 C# Express. The 3D car mesh object is ready for use in C# project. That is, I must use it in my C# project, not in Blender. All the development processes that I need must be done in C# development environment. ...

IDirect3DDevice9, setting how textures scale?

In Photoshop you can control how pictures are scaled up and down as 'image interpolation', it has different options like 'Bicubic', 'Bilinear', 'Nearest Neighbour' and such. I was wondering if I could do something similar in DirectX? Basically if I slap a texture on a quad and stretch the quad how can I control how the texture on the qu...

How to use Text as texture on Cube inside papervision3d?

What is the best technique to apply anti-aliased text as texture on cube using papervision3d? make dynamic textfield, convert it to moviematerial then apply it to the faces of cube. Design a bitmap using any picture editor and make a bitmapFileMaterial to apply on faces of cube. Any other suggestions please. ...

Texture loading at joGL

hi I've been trying to load a bmp picture to use it as a texture at my program I've used a IOstream Class to extend DataInputStream to read the pixels at the photo with this code "based on a texture loader code for c++ " : //class Data members public static int BMPtextures[]; public static int BMPtexCount = 30; public static int curr...

Mapping texture to 3D objects in a batch process on the server

Hi, we have the following use case: the user uploads her picture on a web server at a later time - on the server - the picture(s) are mapped on predefined 3D objects and stored as normal images (png, jpeg, ...). For now just the front-view. The files will be deleted once the session ends. show them in normal img tags to the user In ...

How should I organize OpenGL ES 1.x 2D layer tree?

I'm developing a cute puzzle app - http://gotoandplay.freeblog.hu/categories/compactTangram/ - , and for performance reasons I decided to render the view with OpenGL. I started to learning it, I'm ok with buffers, vertices, textures in a really basic way. The situation: In the game user manipulates 7 puzzlePiece, each has 5 sublayers to...

How to collapse five OpenGL textures into one?

I want to merge 5 "sublayers" to one single texture (you know, somethin' like Flatten Image in Photoshop) in OpenGL ES 1.x iPhone. I'm new to OpenGL, and just haven't find the answer yet. ...

Please help with an OpenGL ES (iPhone) multi-texturing (2D) code!

I have a texture from this PNG: And another from this PNG: They both have the same blend function: glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); I want to see them on one single polygon first. I just couldn't find a simple example of this. Draw them to different polygons works perfect, but I just cannot "merge" them into one text...

OpenGL-ES variable texture alpha (2D)?

I have a texture with transparency (the white triangle with that lighting information), and just can't make it's alpha variable. The drawing code, with the missing piece: //Place polygon vertices to the bottom left within the view. glLoadIdentity(); glTranslatef(centerX, centerY, 0); //Draw "diffuse" layer. glBindTexture(G...

Creating a tiled world with OpenGL

Hello, I'm planning to create a tiled world with OpenGL, with slightly rotated tiles and houses and building in the world will be made of models. Can anybody suggest me what projection(Orthogonal, Perspective) should I use, and how to setup the View matrix(using OpenGL)? If you can't figure what style of world I'm planning to create, lo...

Direct3D Sprite->SetTransform usage?

I draw textures using the D3DXSprite. I want to transform them(rotate, scale etc..) so I use the SetTransfrom method. Should I, store the old transformation -> set a new one -> draw -> set the old one? I have a sprite class whice take care of the Draw and the Update methods. I mean something like this: D3DXMatrix oldMatrix; sprite->GetT...

Alpha/texturing issues in an OpenGL wrapper

I'm in the process of writing a wrapper for some OpenGL functions. The goal is to wrap the context used by the game Neverwinter Nights, in order to apply post-processing shader effects. After learning OpenGL (this is my first attempt to use it) and much playing with DLLs and redirection, I have a somewhat working system. However, when ...

When I load a texture as RGBA4444 in openGL, how much memory is consumed in the device ?

How much memory will consume a texture loaded with this method ? With this method, will a 1024x1024 texture consume 4MB anyway ? ( regardless of loading it as RGBA4444 ) ? -(void)loadTexture:(NSString*)nombre { CGImageRef textureImage =[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:nombre ofType:nil]].CGIm...