textures

OpenGL cube map texture doesn't work

馋奶兔 提交于 2019-12-25 04:48:32
问题 I have problem getting cube maps to work in OpenGL. I followed some tutorials and created my own class wrapping the OpenGL cube map texture. For start I'm trying to load six images for the cube map sides and render them onto a pot model. I want to create a mirror-like effect ultimately but for now I'm using just the normal as the cube map texture coordinate. The problem is the sampler in fragment shader seems to be returning only zeroes so the whole model is just black. my findings so far:

Program crashes when releases UIImage after generating OpenGL ES texture

你离开我真会死。 提交于 2019-12-25 04:36:07
问题 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 autorelease. But the problem is sometimes I want to delete my texture. I need to release those UIImage or else I will have a leak. (The Performance Tool Leaks report that UIImage causes leaks) But if I

Get single sprite from sprite atlas

自作多情 提交于 2019-12-25 04:07:02
问题 I'd like to get a single sprite which GameObject has in a SpriteRenderer component. Unfortunately, this code returns the whole atlas, but I need to a part of this atlas. Texture2D thumbnail = GetComponent<SpriteRenderer>().sprite.texture; 回答1: There is no native API to get single sprite from the SpriteRenderer and no API to access individual Sprite by name. You can vote for this feature here. You can make your own API to get single sprite from Atlas located in the Resources folder like the

A-Frame / THREE.js, no textures simplified gltf[glb] models

我只是一个虾纸丫 提交于 2019-12-25 03:55:31
问题 After simplifying glb successfully with the answer in this post. The textures in are not being applied to the model any more (it appears completely black and unreflective(no material) How would I programmatically get the textures to work with this new simplified geometry? I think its something to do with the uv's but im not to sure how to have it work according to simplified geometry, if even possible. 回答1: THREE.SimplifyModifier currently does not preserve UVs in the geometry, which you'll

OpenGL Texture Combiner - gradient texture

守給你的承諾、 提交于 2019-12-24 21:45:48
问题 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 texture #A, and use an alpha modulated from both textures (alpha from texture A * alpha from texture B). I'm having trouble with my texture combiner code (I already tried monkeying with it) and was wondering

Why can I not load a texture into my app?

可紊 提交于 2019-12-24 15:44:57
问题 I think texture mapping is a really easy task. Actually, I implemented it many times but failed in this time and don't know why? And I can guarantee that the route to load the texture is right. Any other reasons for my confusion? Here is my code: GLuint mytexture; // two functions below come from NeHe's tut. I think it works well. AUX_RGBImageRec *LoadBMP(CHAR *Filename) { FILE *File=NULL; if (!Filename) { return NULL; } File=fopen(Filename,"r"); if (File) { fclose(File); return

Three.js Map material showing warnings despite updating buffers

强颜欢笑 提交于 2019-12-24 14:40:34
问题 I'm trying to load an OBL object and, on pre-specified containers (plains) display a texture. However, after I load an object, I start getting the following errors: THREE.WebGLRenderer 58 XHR finished loading: "http://localhost:8000/original-material/room2/soba-5-2.obj". about to traverse... about to add to scene WebGLRenderingContext: GL ERROR :GL_INVALID_OPERATION : glDrawElements: attempt to access out of range vertices in attribute 0 WebGL: too many errors, no more errors will be reported

Opengl Texture Transparency .BMP

天涯浪子 提交于 2019-12-24 13:39:34
问题 I am drawing a polygon with texture on it as part of the HUD in my OpenGL program. //Change the projection so that it is suitable for drawing HUD glMatrixMode(GL_PROJECTION); //Change the projection glLoadIdentity(); glOrtho(0, 800, 800, 0, -1, 1); //2D Mode glMatrixMode(GL_MODELVIEW); //Back to modeling glLoadIdentity(); //Draw the polygon with the texture on it glBegin(GL_POLYGON); glTexCoord2f(0.0, 1.0); glVertex3f(250.0, 680, 0.0); glTexCoord2f(1.0, 1.0); glVertex3f(570.0, 680, 0.0);

How to you define attaching a texture array to a FBO's color attachment point visually?

风流意气都作罢 提交于 2019-12-24 12:10:38
问题 I read that in layered rendering, we create a 2D texture array (GL_TEXTURE_2D_ARRAY): glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D_ARRAY, TextureColorbufferName); glTexParameteri(.... glTexImage3D(... and can attach it to FBO: glGenFramebuffers(1, &FramebufferName); glBindFramebuffer(GL_FRAMEBUFFER, FramebufferName); glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, TextureColorbufferName, 0); What i find hard to understand visually is how can a layer of textures be

how to load texture for meshes (not a3d object!) in renderscript?

半腔热情 提交于 2019-12-24 10:57:49
问题 I have been creating meshes using equations, but applying texture seems to be an issue. I have created a cube and cylinder but when texture is applied, the texture is not getting allocated and only the object is visible. I created a Cylinder successfully with the help of this link - How to make a cylinder in renderscript and I've created a cube of my own. The 2 objects are visible, but not the texture applied on them. I'm able to allocate textures only for my a3d objects that I've created,