textures

Android opengl issue (weird)

半腔热情 提交于 2019-12-09 17:48:25
问题 this is a weird one. I have a basic application (dashboard, ...) and a GLSurfaceview in which I draw 3D objects and textures. All runs pretty but when I go back in other activities, hmm well a screenshot is better than words: This is the dashboard before this is the opengl: And this is my dashboard when I press back: As you can see, the images are gone and text too. I run on 4.0+ so I suppose this is because android draws elements with opengl, as it doesn't do that on my 2.2 device. Do you

Casting shadow on MeshPhongMaterial or MeshLambertMaterial in Three.js

坚强是说给别人听的谎言 提交于 2019-12-09 17:23:38
问题 I feel like I'm missing something simple here. I used JSFiddle by @WestLangley, which demonstrates how to cast a shadow from an object onto a plane. Everything works as expected when the plane is filled with just color: var groundMaterial = new THREE.MeshLambertMaterial({ color: 0xFF0000 }); Then I change it to use texture instead: var groundMaterial = new THREE.MeshLambertMaterial({ // color: 0xFF0000, map: texture }); ..all of a sudden, shadow is gone: This happens with both

How do I make textures transparent in OpenGL?

旧城冷巷雨未停 提交于 2019-12-09 13:01:51
问题 I've tried to research this on Google but there doesn't appear to me to be any coherent simple answers. Is this because it's not simple, or because I'm not using the correct keywords? Nevertheless, this is the progress I've made so far. Created 8 vertices to form 2 squares. Created a texture with a 200 bit alpha value (so, about 80% transparent). Assigned the same texture to each square, which shows correctly. Noticed that when I use a texture with 255 alpha, it appears brighter. The init is

Loading 4-channel texture data in iOS

耗尽温柔 提交于 2019-12-09 12:55:30
问题 I want to load 4-channel texture data from a file in iOS, so I consider the texture as a (continuous) map [0,1]x[0,1] -> [0,1]x[0,1]x[0,1]x[0,1] If I use the fileformat .png , XCode/iOS consider the file as an image, and so multiplies each component rgb with a (premultiplied alpha), corrupting my data. How should I solve this? Examples may be use two textures with components rgb (3-channel) postdivide alpha use another file format Of these, I consider the best solution to be to use another

Textured spheres without strong distortion

血红的双手。 提交于 2019-12-09 12:44:15
问题 I've seen well-textured balls, planets, and other spherical objects in couple of games, last time in UFO: aftermath. If you just splatter a texture into latitude/longditude as u and w -coordinates you'll get lots of ugly texture distortion to poles. I can think myself an one way to implement a spherical map with minimum distortion. By mapping in triangles instead of squares. But I don't know any algorithms. How to produce vertices and texture coordinates for such spheres? Also, I don't see a

openGL ES textures from PNGs with transparency are being rendered with weird artifacts and driving me nuts!

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-09 09:26:59
问题 I am beginning to work on my first OpenGL iPhone app, but I've hit an early snag. I have a VERY SIMPLE little texture that I want to use as a sprite in a 2D game, but it renders with weird 'randomly' colored pixels up top. http://i40.tinypic.com/2s7c9ro.png <-- Screenshot here I sort of get the feeling that this is Photoshop's fault, so if anybody something about that please let me know. If it's not photoshop then it's gotta be my code... So here is the code in question... - (void)loadTexture

Texture from texturepacker in LibGDX

淺唱寂寞╮ 提交于 2019-12-09 06:44:57
问题 Trying get my head around the texture wrapper in (the awesome) LibGDX framework and I need help. I would like to bind a texture (according to Mesh, Color & Texture) that is extracted from a TextureAtlas packed with the TexturePacker. The texture is binding to a rectangular mesh. I want the texture (instance of Texture) to basically be extracted from a packed file. Is it doable to use a the createsprite or findregion methods and somehow skip the filehandle step? Additionally: Anything special

How to create black and white transparent overlapping histograms using ggplot2?

给你一囗甜甜゛ 提交于 2019-12-09 05:59:41
问题 I used ggplot2 to create two transparent overlapping histograms. test = data.frame(condition = rep(c("a", "b"), each = 500), value = rep(-1, 1000)) test[1:500,]$value = rnorm(500) test[501:1000,]$value = rnorm(500) + 2 fig = ggplot(test, aes(x = value, fill = condition)) + #scale_fill_grey() + geom_histogram(position = "identity", alpha = .5) fig The resulting plot looks great, but it's in color. I need a grayscale or black/white plot. Using "scale_fill_grey()" results in a plot with

Precise control over texture bits in GLSL

自古美人都是妖i 提交于 2019-12-09 02:51:43
问题 I am trying to implement an octree traversal scheme using OpenGL and GLSL, and would like to keep the data in textures. While there is a big selection of formats to use for the texture data (floats and integers of different sizes) I have some trouble figuring out if there is a way to have more precise control over the bits and thus achieving greater efficiency and compact storage. This might be a general problem, not only applying to OpenGL and GLSL. As a simple toy example, let's say that I

Libgdx save SpriteBatch in a texture

邮差的信 提交于 2019-12-08 19:13:28
I would like to know if it possible to save a spriteBatch in a texture . SpriteBatch batch = new SpriteBatch(); After drawing a few thing inside the batch , I would like to save all thing that contains the SpriteBatch in One texture (something like a screenshot ). I have no idea to how to do it, I searched on the web and on the libgdx doc but didn't found. Thanks you You can render to a FrameBufferObject (FBO). See https://github.com/mattdesl/lwjgl-basics/wiki/FrameBufferObjects An FBO will work if you are okay with making the decision to render to a texture in advance. One side-effect is that