texture

Changing image of a skspritenode()

匿名 (未验证) 提交于 2019-12-03 01:22:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This is how I add my player's texture/image: Player = SKSpriteNode(imageNamed:"player8") How do I change the players texture/image without adding or deleting spritenodes? 回答1: You assign a different texture : player = SKSpriteNode(imageNamed:"player8") Sometime later: player.texture = SKTexture(imageNamed:"player123") Hint: it is bad style to begin variable, property and method names with an uppercase character as it makes them appear to be classes. 文章来源: Changing image of a skspritenode()

what does bake do in SceneKit

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What is the purpose of "bake" option in SceneKit editor. Does it have an impact on performance? Type offers 2 options: Ambient Occlusion and Light Map Destination offers: Texture and Vertex 回答1: For me, it crashes Xcode. It's supposed to render lighting (specifically shadows) into the textures on objects so you don't need static lights. This should, theoretically, mean that all you need in your scene are the lights used to create dynamic lighting on objects that move, and you can save all the calculations required to fill the scene with

Text not rendering correctly - OpenGL using FreeType2

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Almost exact duplicate question: OpenGL font rendering using Freetype2 . I am trying to render text in my OpenGL program using FreeType2 (2.5.3), based on this tutorial: http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Text_Rendering_02 , using the same structs as Bentebent did in his question (above). I am having the same problem he was having with rectangles showing up instead of legible characters (even using the correct GL_TEXTURE0 parameter for glActiveTexture() ) For example, rendering green strings "Hello" and

Swift - Must call a designated initializer of the superclass SKSpriteNode error

匿名 (未验证) 提交于 2019-12-03 01:17:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This code worked on first XCode 6 Beta, but on latest Beta it's not working and gives such errors Must call a designated initializer of the superclass SKSpriteNode : import SpriteKit class Creature: SKSpriteNode { var isAlive:Bool = false { didSet { self.hidden = !isAlive } } var livingNeighbours:Int = 0 init() { // throws: must call a designated initializer of the superclass SKSpriteNode super.init(imageNamed:"bubble") self.hidden = true } init(texture: SKTexture!) { // throws: must call a designated initializer of the superclass

com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: - Error

匿名 (未验证) 提交于 2019-12-03 01:17:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to develop an application in libGDX for iOS. In my Java class I have written this line private Texture texture = new Texture(Gdx.files.internal("data/folder_name_1/folder_name_2/abcd.png")); and my robovm.xml looks like this- Info.plist.xml ../android/assets ** true data When I try to run the code on iOS simulator it runs fine. But when I try to run it on an iOS device i.e. iPhone. It generates an error which looks like this- com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: data/folder_name_1/folder_name_2/abcd.png

glsl sampler2DShadow and shadow2D clarification

匿名 (未验证) 提交于 2019-12-03 01:13:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Quick background of where I'm at (to make sure we're on the same page, and sanity check if I'm missing/assuming something stupid): Goal: I want to render my scene with shadows, using deferred lighting and shadowmaps. Struggle: finding clear and consistent documentation regarding how to use shadow2D and sampler2DShadow. Here's what I'm currently doing: In the fragment shader of my final rendering pass (the one that actually calculates final frag values), I have the MVP matrices from the pass from the light's point of view, the depth texture

THREE.js generate UV coordinate

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am working on importing a model into a scene using the THREE.js OBJ loader. I know that I am able to import the geometry fine, because when I assign a MeshNormalMaterial to it, it shows up great. However, if I use anything that requires UV coordinates, It gives me the error: [.WebGLRenderingContext]GL ERROR :GL_INVALID_OPERATION : glDrawElements: attempt to access out of range vertices in attribute 1 I know this is because the loaded OBJ has no UV coordinates, but I was wondering if there was any way to generate the needed texture

SDL: Render Texture on top of another texture

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i am having trouble with the following: I need to render a texture on top of another texture and then render that main texture. For example I have the blue rectangle texture, and I want to draw red rectangles on top of this blue rect. However i want them to restrict the render only on this rectangle. Like the following image: I read something about texture blit between them or something like that but im not sure if this is posible. My code looks like this: SDL_RenderCopy(ren,bluetexture,NULL,dBLUErect); SDL_RenderCopy(ren,redtexture,NULL

Three.js Rotate Texture

匿名 (未验证) 提交于 2019-12-03 01:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a texture applied to a mesh I can change the offset with mesh.material.map.offset.set I can change the scaling with mesh.material.repeat.set so my question is, how can I rotate texture inside a plane? Example: From This: To this Thanks. 回答1: use 2D canvas as a texture demo: https://dl.dropboxusercontent.com/u/1236764/temp/stackoverflow_20130525/index.html example code var camera, scene, renderer, mesh; var width = window.innerWidth; var height = window.innerHeight; scene = new THREE.Scene(); camera = new THREE.PerspectiveCamera( 30,

Three JS Map Material causes WebGL Warning

匿名 (未验证) 提交于 2019-12-03 01:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to define a material to meshes I loaded in from OBJLoader through the following wrapper function: function applyTexture(src){ var texture = new THREE.Texture(); var loader = new THREE.ImageLoader(); loader.addEventListener( 'load', function ( event ) { texture.image = event.content; texture.needsUpdate = true; // find the meshes from the loaded OBJ and apply the texture to it. object.traverse( function ( child ) { if ( child instanceof THREE.Mesh ) { if(child.name.indexOf("Lens") When the texture has loaded and it's time to apply