textures

360 viewer in unity, texture appears warped in the top and bottom

流过昼夜 提交于 2019-11-28 11:36:42
I am making a 360 viewer in unity, to view a 360 photo I used to have a cubemap attached to a skybox, and it worked great. But the weight of the cubemaps forced me to switch to textures. All of the 360 viewer tutorials say to just put a sphere with a shader on it, and put the camera inside. When I do this, it doesn't work very well, because when I look to the top or bottom, I see the image warped like so: (The chairs are suppossed to look normal) It did not happen when I used a skybox. Does any one know why is this happening? Thank you very much! The shader you choose does not handle

Extruding multiple polygons with multiple holes and texturing the combined shape

梦想与她 提交于 2019-11-28 11:35:58
This question is related to this question . The answer shows very nice way to extrude polygons that have holes (see the excellent live example ). The main learning of the answer was that paths in three.js (r58) cannot have more than one moveTo command and it have to be in the start of the path, which means that path have to be broken by moveTos, so that moveTo start always a new path. Extruding in three.js means that 2D paths are converted to 3D shapes using possible beveling. It is suitable for extruding texts to make 3D letters and words, but can be used also to extrude custom paths. Now

What are the usual troubleshooting steps for OpenGL textures not showing?

跟風遠走 提交于 2019-11-28 10:55:40
After making a few changes in my application, my textures are no longer showing. So far I've checked the following: The camera direction hasn't changed. I can see the vectors (when colored instead of textured). Any usual suspects? You may want to check the following: glEnable(GL_TEXTURE_2D); presence glBindTexture(GL_TEXTURE_2D, texture[i]); and glBindTexture(GL_TEXTURE_2D, 0); when you don't need texture anymore A few more things to check: glColorMaterial(...); To make sure colors aren't overwriting the texture glEnable/glDisable(GL_LIGHTING); Sometimes lighting can wash out the texture

Can I use a grayscale image with the OpenGL glTexImage2D function?

限于喜欢 提交于 2019-11-28 10:54:16
I have a texture which has only 1 channel as it's a grayscale image. When I pass the pixels in to glTexImage2D, it comes out red (obviously because channel 1 is red; RGB). glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, dicomImage->GetColumns(), dicomImage->GetRows(), 0, GL_RGBA, GL_UNSIGNED_BYTE, pixelArrayPtr); Do I change GL_RGBA? If so, what to? Change it to GL_LUMINANCE. See http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/teximage2d.html It appears that I should use GL_LUMINANCE instead of GL_RGBA for the 3rd argument. Edit (in reply to comments): When I set the 7th

Using MPMoviePlayerController as texture in SceneKit

你离开我真会死。 提交于 2019-11-28 10:40:53
问题 I created a cube in scenekit and tried to use an instance of an MPMoviePlayerController as its material. It kind-ish works but not exactly well: the video seems to be very jumpy, like it would be jumping between the video frames (basically replaying frames from the beginning till the last point played). The sound is ok. I made a short screencapture of what's happening, I guess it is obvious from the video: Youtube vid This is the code that handles the mapping to the cube and the creation of

Can a three.js material have separate repeat values for a bump map and a texture map?

回眸只為那壹抹淺笑 提交于 2019-11-28 10:33:42
I'm trying to break up the repetition in my texture by applying a bump map which repeats much less frequently. Unfortunately, it seems to take on the repeat value of 'landTexture' below (64), instead of the value I set it to (1). landTexture.wrapS = landTexture.wrapT = THREE.RepeatWrapping; landTexture.repeat.set(64, 64); bumpTexture.wrapS = bumpTexture.wrapT = THREE.RepeatWrapping; bumpTexture.repeat.set(1, 1); var m = new THREE.MeshPhongMaterial({map:landTexture, ambient: 0x552811, specular: 0x333333, shininess: 25, bumpMap: bumpTexture, bumpScale: 1, metal: false }); If I comment out map

Incorrect result when using 3D textures

三世轮回 提交于 2019-11-28 09:59:36
问题 I'm using modern OpenGL 4.3 core. I just realized that 1024p x 1024p tileset is too small for my needs. So, I replaced it with 1024p x 1024p x 4p 3D texture. (I know, it's not the best solution, and I better to use 2D texture array. I'm just wondering why my current solution doesn't work.) x and y texture coordinates work fine, same as before. z also work, but a bit incorrectly. I would expect the 1st layer to have z == 0.0 , 2nd layer - z == 0.3333333 , 3rd layer - z == 0.66666666 and 4rd

How do I get textures to work in OpenGL?

陌路散爱 提交于 2019-11-28 09:32:52
问题 I'm using the tutorials on http://arcsynthesis.org/gltut/ to learn OpenGL, it's required, I have to use it. Mostly I want to apply the textures from Tutorial 15 onto objects in tutorial 7 (world with UBO). For now it seemed like the textures only work when mipmaps are turned on. This comes with a downside: The only mipmap used is the one with an index of zero, and that's the 1 colored 1x1 pixel one. I tried setting the minimum level of a mipmap higher or turning off mipmaps entirely, but even

How to save bitmap from GLSurfaceView (Only bitmap, not whole texture)

你。 提交于 2019-11-28 09:28:15
I am using this code to give multiple effect on bitmap that is on GlSurfaceView. apply-effects-on-image-using-effects Now, I want to save the bitmap. They have given the code to save the bitmap but with that, whole GlSurfaceView is going to be saved as bitmap image. Instead I want to save only bitmap area to save as Image. There is method that takes pixels and make bitmap from that and also make image. e.g.: public Bitmap takeScreenshot(GL10 mGL) { final int mWidth = mEffectView.getWidth(); final int mHeight = mEffectView.getHeight(); IntBuffer ib = IntBuffer.allocate(mWidth * mHeight);

Three.js texture / image update at runtime

假如想象 提交于 2019-11-28 09:12:16
I am trying to change a cube image at run time by selecting an option from Select Form element. When running the code, the image changes after selecting, but the previous cube and image stays in the scene. How I clear / refresh / update the scene properly when changing the material / image / texture. <div id = "container"></div> <form id = "changesForm"> Cube Image: <br> <select id = "cubeImage"> <option value = "random">Random</option> <option value = "image1">First Image</option> <option value = "Image2">Second Image</option> </select> <br> </form> <script type = "text/javascript"> window