textures

SurfaceTexture/Surface mapping with ANativeWindow

Deadly 提交于 2020-01-07 04:57:05
问题 Given a GraphicBufferProducer I create a Surface and then retrieve ANativeWindow. Using ANativeWindow_lock I get a pointer to the buffer. Using the buffer, I do a memcpy into the buffer. The problem is that whatever I draw on this buffer is restricted to less than 25% of the screen. Keep in mind that the dimensions of buffer.width and buffer.height are very close to the resolution of the screen itself. My question is, why does the buffer only cover a small portion of the screen? And how do I

How do color and textures work together?

你离开我真会死。 提交于 2020-01-07 00:57:08
问题 I must be asking a very basic question. I've just learnt how to apply textures. Basically, I have a scene (a plane) and a cube on it. I apply a texture to one of the faces of the cube. The face of the cube I am trying to apply the texture to is red, but I want the texture color to override it, but they somehow blend together, although I have not enabled blending, nor is the texture image transparent ! Here's my texture(.png). And here's the rendering: Here are some relevant parts of my code (

The renderer is not using the texture in Open TK

微笑、不失礼 提交于 2020-01-06 17:56:36
问题 Hi I'm trying to use Textures in OpenGL using Open TK. I got a basic example from the official page of OpenTK Framework, but didn't work. I searched here on stackoverflow for some help and changed some parts of the code, but still is not working. (Found and tested: OpenTk texture not display the image) So far I came with this snippet, but this is not displaying the texture (display white instead): UPDATED (With @The Fiddler suggestions) In OpenTK.GLControl.Load event handler: GL.ClearColor

Loading textures with JSONloader

那年仲夏 提交于 2020-01-06 15:49:32
问题 I'm a newbie, and I think I missed something. Could someone check, please? HTML page: http://xalien95.altervista.org/pkmnxy_engine/alisopoli.html MODEL and TEXTURES: http://xalien95.altervista.org/pkmnxy_engine/alisopoli/ I can see the model (with weird colors), but not the textures (it's a mesh with multiple materials). Thanks in advance! EDIT: I tried with all the materials types: THREE.MeshBasicMaterial THREE.MeshDepthMaterial THREE.MeshLambertMaterial THREE.MeshNormalMaterial THREE

Glscene Ugly Texture with Materiallib

懵懂的女人 提交于 2020-01-06 09:03:41
问题 I am using GLScene in my delphi project. I add some freeform on my scene (for example tooth). in the past I don't use material libs. I add my texture via the material property directrly of the freeform. Now I have to use materiallibs because I want to use some shader. But if I add a materiallib to my free from I get a ugly result from it. You can see the effect on this picture Where is my mistake? Thanks for any answer or tip 回答1: Apparently the texture is not active. Did you enable it in the

Cocos2d: creating an instance of CCRenderTexture crashes my App but can't figure out how to debug this

て烟熏妆下的殇ゞ 提交于 2020-01-06 08:52:26
问题 EDIT (shorter version after additional testing): I only added: CGSize winSize = [[CCDirector sharedDirector] winSize]; CCRenderTexture *rt = [CCRenderTexture renderTextureWithWidth:winSize.width height:winSize.height]; to my BulletCache in my game project (that has a GameScene where an instance of BulletCache is added) and now the app does crash whilst trying to load the gamescene instance (before this I had no problems with this crash). NOTE: I added a breakpoint in the init method of

Cocos2d: creating an instance of CCRenderTexture crashes my App but can't figure out how to debug this

好久不见. 提交于 2020-01-06 08:52:13
问题 EDIT (shorter version after additional testing): I only added: CGSize winSize = [[CCDirector sharedDirector] winSize]; CCRenderTexture *rt = [CCRenderTexture renderTextureWithWidth:winSize.width height:winSize.height]; to my BulletCache in my game project (that has a GameScene where an instance of BulletCache is added) and now the app does crash whilst trying to load the gamescene instance (before this I had no problems with this crash). NOTE: I added a breakpoint in the init method of

Improve the quality of texture sample in Direct3D

房东的猫 提交于 2020-01-06 08:43:38
问题 I'm using directx 11 to render video.I create a Texture2D and copy rgba video data into it.Also it is the resource of pixel shader.Here is code: void CreateTexture(int nWidth, int nHeight) { D3D11_TEXTURE2D_DESC textureDesc; textureDesc.Width = nWidth;//Video width textureDesc.Height = nHeight;//Video height textureDesc.MipLevels = 1; textureDesc.ArraySize = 1; textureDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; textureDesc.SampleDesc.Count = 1; textureDesc.Usage = D3D11_USAGE_DYNAMIC;

Efficiency comparison between invididual textures and a texture sheet in OpenGL ES

两盒软妹~` 提交于 2020-01-06 08:36:32
问题 It's generally regarded that using a big texture 'image' full of many smaller textures (think font sheets) is faster than having each texture separate. How big is the improvement in performance? Would it be noticeably faster or will it be a minor improvement? 回答1: Would it be noticeably faster or will it be a minor improvement? It depends on how many textures you are using. If you have few textures, you can be fine with separate textures. If you are making a big world containing of lots of

Draw lines and fills with a chalk texture in iPhone app

你。 提交于 2020-01-06 07:07:09
问题 I have code in my iPhone app to draw a pie chart in a UIView. All is great but I need to be able to use a chalk-like texture to draw the outlines and then to fill in the different colours of the pie chart. Here are extracts from the existing code for each area: Drawing the circle around the pie chart: CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(ctx, 1.0, 1.0, 1.0, 1.0); CGContextSetLineWidth(ctx, 8.0); // Draw a thin line around the circle CGContextAddArc(ctx,