textures

Copy ffmpeg d3dva texture resource to shared rendering texture

隐身守侯 提交于 2019-12-06 08:55:54
问题 I'm using ffmpeg to decode video via d3dva based on this example https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/hw_decode.c. I'm able to succesfully decode video. What I need to do next is to render decoded NV12 frame. I have created directx rendering texture based on this example https://github.com/balapradeepswork/D3D11NV12Rendering and set it as shared. D3D11_TEXTURE2D_DESC texDesc; texDesc.Format = DXGI_FORMAT_NV12; // Pixel format texDesc.Width = width; // Width of the video

How check the .spriteatlas sizes generated by Xcode?

孤人 提交于 2019-12-06 08:47:05
I'm using texture atlas for handling my images. I didn't created the atlas by myself however I let Xcode to do this for me: My question is: How can I see this file or know its properties (I mean, sizes and weight)? What if and how can I know if the sizes exceed the maximum size of 4098 x 4098 pixel? 来源: https://stackoverflow.com/questions/33561727/how-check-the-spriteatlas-sizes-generated-by-xcode

Visualizing the Stencil Buffer to a texture

有些话、适合烂在心里 提交于 2019-12-06 08:08:52
问题 I'm trying to put the stencil buffer into a texture for use in a deferred renderer. I'm getting other Color and Depth Attachments with glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textures[color1], 0); and the result is correct. However when I try to attach my stencil buffer to a texture with glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT ,GL_TEXTURE_2D, textures[stencil], 0); I get a garbled result, as if the FBO isn't clearing its buffers. I don

sphere texture mapping error

為{幸葍}努か 提交于 2019-12-06 07:47:39
i use D3DXCreateSphere method to create sphere mesh. and i want to apply an earth texture on it. i calculate the texture coordinate in pixel shader with following code: sampler ShadeSampler = sampler_state { Texture = (ShadeTex); AddressU = Mirror; AddressV = Mirror; MinFilter = LINEAR; MagFilter = LINEAR; MipFilter = LINEAR; }; PS_OUTPUT PSMain(VS_OUTPUT input){ PS_OUTPUT output = (PS_OUTPUT)0; vector uv; uv.x = 0.5 + atan2(input.normal.z, input.normal.x) / piMul2; uv.y = 0.5f - asin(input.normal.y) / pi; vector b = tex2D(ShadeSampler, uv.xy); output.diffuse = b * input.diffuse; return output

C++ SDL2 Error when trying to render SDL_Texture: Invalid texture

家住魔仙堡 提交于 2019-12-06 07:35:01
I'm trying to make a simple game and when I try rendering my SDL_Texture , I get an inexplicable error. I've set up everything right, I'm able to successfully clear the screen with SDL_RenderClear , and my texture isn't null, so it should have been created properly. But when I try calling the render() function I get an error, and SDL_GetError() returns "Invalid texture". Edit: I have now created an MCVE as requested, and I tested it to verify that it reproduces the error. It should display the image at the path "gfx/grid.bmp" in the window, but instead it gives me the error. Here is the full

Fetching CUDA texture problems

只愿长相守 提交于 2019-12-06 06:08:47
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->width, cornerImage->height, cornerImage->widthStep);

Creating and loading .pngs in RGBA4444 RGBA5551 for openGL

给你一囗甜甜゛ 提交于 2019-12-06 05:53:31
I'm creating an openGL game and so far I have been using .pngs in the RGBA8888 format as texture sheets, but those are too memory hungry, and my app crashes frequently. I read in Apple's site that such format such be used just when too much quality is needed, and recommends to use RGBA4444 and RGBA5551 instead ( I already converted my textures to PVR but the quality loss is too great in most of the sprite sheets). I only need to use GL_UNSIGNED_SHORT_5_5_5_1 or GL_UNSIGNED_SHORT_4_4_4_4 in my glTexImage2D call inside my texture loader class in order to load my textures, but I need to convert

Replicate OpenGL Blending in Metal

﹥>﹥吖頭↗ 提交于 2019-12-06 05:38:56
I have been working on porting an open source game written using a fixed function pipeline to Metal. I have been able to redo all the projection transformation and have things being drawn where they should be drawn with the correct texture and vertex information but I'm having lots of trouble getting the fragment shader to match the OpenGL blending, the textures look correct but the blending and brightness are off. Here is what I'm trying to match: here is how it is currently rendering: The code I can see controlling the GL Blending looks like: glShadeModel(GL_SMOOTH); glEnable(GL_ALPHA_TEST);

Tiling Simplex Noise?

那年仲夏 提交于 2019-12-06 05:28:46
问题 I've been interested (as a hobbyist) in pseudo-random noise generation, specifically the Perlin and Simplex algorithms. The advantage to Simplex is speed (especially at higher dimensions), but Perlin can be tiled relatively easily. I was wondering if anyone was aware of a tiling simplex algorithm? Fixed-dimension is fine, generic is better; pseudocode is fine, c/c++ is better. 回答1: Just tile your noise the same way you would in Perlin only do it after the skew. You can do this by modifying

How to manage multiple textures in OpenGL ES 2.0?

本小妞迷上赌 提交于 2019-12-06 04:42:34
问题 I have a OpenGL ES 2.0 app with 6 different textures. What I need is to draw and move them all at the same time. I was able to do it, but the movement was laggy because I was loading the bitmaps into the textures all the time. For each texture, I do the following on the Render method: setupImage(texture1); GLES20.glVertexAttribPointer(mPositionHandle, 3, GLES20.GL_FLOAT, false, 0, vertexBufferT1); GLES20.glVertexAttribPointer(mTexCoordLoc, 2, GLES20.GL_FLOAT, false, 0, uvBufferT1); GLES20