texture

How to use a shaderModifier to alter the color of specific triangles in a SCNGeometry

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: First, before I go on, I have read through: IOS8 Scenekit painting on texture with texture coordinates which seems to suggest I'm on the right track. I have a complex SCNGeometry representing a hexasphere. It's rendering really well, and with a full 60fps on all of my test devices. At the moment, all of the hexagons are being rendered with a single material, because, as I understand it, every SCNMaterial I add to my geometry adds another draw call, which I can't afford. Ultimately, I want to be able to color each of the almost 10

Android OpenGL Texture Compression

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I need some help finding information (or an example) of how to use texture compression for Android. I have a lot of PNG's right now and I need to reduce the amount of memory they take up. I was looking at PVR compression but I can't figure out how to use this within OpenGL. Could some point me in the right direction or offer some examples as I cannot find anything. 回答1: There are mainly four texture compression types supported on Android: ETC1 (Ericsson texture compression) . This format is supported by all Android phones. But, it

Fetching CUDA texture problems

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am having trouble fetching a texture of floats. The texture is defined as follows: texture<float, 2, cudaReadModeElementType> cornerTexture; The binding and parameter settings are: cornerTexture.addressMode[0] = cudaAddressModeClamp; cornerTexture.addressMode[1] = cudaAddressModeClamp; cornerTexture.filterMode = cudaFilterModePoint; cornerTexture.normalized = false; cudaChannelFormatDesc cornerDescription = cudaCreateChannelDesc<float>(); cudaBindTexture2D(0, &cornerTexture, cornerImage->imageData_device, &cornerDescription, cornerImage-

CCSprite: Batched sprites should use the same texture as the batchnode?

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I keep getting a crash that says: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'CCSprite: Batched sprites should use the same texture as the batchnode' I am not quite sure what this means. I googled the crash but got no results. Also this only happens when I go back to my first scene after coming back from the second scene in my game. I double checked my code and I make sure all the images in my sprite sheets are added as children to the batch node. I also make sure the images in my app that aren

Opengl: Use single channel texture as alpha channel to display text

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What I'm trying to do is load a texture into hardware from a single channel data array and use it's alpha channel to draw text onto an object. I am using opengl 4. If I try to do this using a 4 channel RGBA texture it works perfectly fine but for whatever reason when I try and load in a single channel only I get a garbled image and I can't figure out why. I create the texture by combing texture bitmap data for a series of glyphs with the following code into a single texture: int texture_height = max_height * new_font->num_glyphs; int texture

Save AcquireCameraImageBytes() from Unity ARCore to storage as an image

匿名 (未验证) 提交于 2019-12-03 08:59:04
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Using unity, and the new 1.1 version of ARCore, the API exposes some new ways of getting the camera information. However, I can't find any good examples of saving this as a file to local storage as a jpg, for example. The ARCore examples have a nice example of retrieving the camera data and then doing something with it here: https://github.com/google-ar/arcore-unity-sdk/blob/master/Assets/GoogleARCore/Examples/ComputerVision/Scripts/ComputerVisionController.cs#L212 and there are a few examples of retrieving the camera data in that class, but

Passing Metal texture2d_array to SceneKit shader modifier

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to create shader modifier for SCNMaterial (with SCNShaderModifierEntryPointSurface ) and pass Metal texture2d_array as custom input. To achieve that I try to use key-value coding setting parameter of type SCNMaterialProperty . From SceneKit manual on SCNMaterialProperty property contents : You can set a value for this property using any of the following types: ... A texture (SKTexture, MDLTexture, MTLTexture , or GLKTextureInfo) ... So, I construct MTLTexture : Create MTLTextureDescriptor with type MTLTextureType2DArray Create

SceneKit - Map cube texture to box

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've a texture for a cube that looks like I'd like to use it on a cube in a SceneKit view. I'm using the SceneKit geometry SCNBox for that. Unfortunately, the result is that the texture is projected entirely on each face, instead of using only the corresponding part: let videoGeometry = SCNBox(width: 1, height: 1, length: 1, chamferRadius: 0) videoGeometry.firstMaterial?.isDoubleSided = true videoGeometry.firstMaterial?.diffuse.contents = UIImage(named: "test")! I know I can use shader modifiers on the geometry but I'm not sure where to get

Using GraphicBuffers to fast read from a texture

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am working on some code that runs some GPGPU code on Android using shaders. Usually a Framebuffer is used so the result of the computation is stored in a texture. Also the input data is usually a texture. To improve performance it would be great to get rid of glTexImage2D and glReadPixels to upload and download images to and from the GPU memory space. All the code related to OpenGL is native. On Android GraphicBuffer can be used on Android for this propose because in mobile devices gpu memory is just host RAM memory. This structure allows

Android OpenGL ES 2.0 : Can a GL_FLOAT texture be assigned to a FBO as a COLOR attachment?

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to get the value using GL_FLOAT texture by glReadPixels. My Android device support OES_texture_float . but, it became an error to attach GL_FLOAT texture. In OpenGL ES 2.0 in Android, to attach GL_FLOAT texture to FBO is impossible? Or depend on hardware? Part of my code is: Init: glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D,texture); glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,texWidth,texHeight,0,GL_RGB,GL_FLOAT,NULL); FBO Attach: glBindFramebuffer(GL_FRAMEBUFFER,framebuffer); glFramebufferTexture2D(GL_FRAMEBUFFER,GL_COLOR