texture2d

SaveDDSTextureToFile() saves a black texture instead the expected

无人久伴 提交于 2019-12-24 11:55:18
问题 I have created a red colored texture of DXGI format DXGI_FORMAT_R32_FLOAT. I have a byte buffer of red color pixels where 4 byte per pixel is prepared. The byte buffer is then copied using device context map and unmap functions and after that I have created a shader resource view. I have get the resource back from resource view then passed that to SaveDDSTextureToFile() to save the bitmap data to dds file format. But when I am going to save it in dds in file to check it's saves a same sized

Optimal way to set pixel data?

喜夏-厌秋 提交于 2019-12-24 01:47:23
问题 I'm working on a "falling sand" style of game. I've tried many ways of drawing the sand to the screen, however, each way seems to produce some problem in one form or another. List of things I've worked through: Drawing each pixel individually, one at a time from a pixel sized texture. Problem: Slowed down after about 100,000 pixels were changing per update. Drawing each pixel to one big texture2d, drawing the texture2d, then clearing the data. Problems: using texture.SetPixel() is very slow,

Drawing text as textures on squares does not show anything

本小妞迷上赌 提交于 2019-12-24 00:04:12
问题 I'm new to OpenGL and I'm developing an Augmented-reality application for Android. Until now, I was drawing white squares, perpendicular to the camera, pointing the user to the direction where a "Point of interest" would be. Now, I'm trying to show some text into the squares. I've read a lot and it seems that creating a texture with the text is the most direct and easiest approach, so I'm creating the textures as soon as I get data of the Points of interest and stick them to their squares.

c++ Directx11 capture screen and save to file

女生的网名这么多〃 提交于 2019-12-23 12:20:03
问题 i've got problem with saving texture2d to file, it always gives me black image. Here is code: HRESULT hr = SwapChain->GetBuffer( 0, __uuidof( ID3D11Texture2D ), reinterpret_cast< void** >( &g_pSurface ) ); if( g_pSurface ) { ID3D11Texture2D* pNewTexture = NULL; D3D11_TEXTURE2D_DESC description; g_pSurface->GetDesc( &description ); description.BindFlags = 0; description.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE; description.Usage = D3D11_USAGE_STAGING; HRESULT hr =

Make texture2D readable in runtime/script Unity3D [duplicate]

妖精的绣舞 提交于 2019-12-22 17:36:19
问题 This question already has an answer here : How to make Texture2D Readable via script (1 answer) Closed 2 years ago . I have a plugin that allows me to access pictures from an Android phones gallery. This gives me a texture of the Texture2D type. I then want to edit it using the GetPixels function, but it is not set to readable by default. How would I make the texture readable so I can use GetPixels on it? Basically I am allowing the user to select a picture from the phone and then crop it. In

GLES20 Texture Not Working on Some Devices

不打扰是莪最后的温柔 提交于 2019-12-22 12:57:20
问题 I have tried to add a fairly simple extension on top of Android's example OpenGL 2.0 project in order to add texturing to basic shapes. This seems pretty straightforward, but on certain devices (Samsung Nexus S, LG Optimus 3D, Samsung Galaxy S) the texture just does not render. This is actually a problem that I am having on a much larger project, but I was able to reproduce the issue with the simple project below in the hope that someone here has an idea of where my code presents issues, or

DirectX Image texture quad displays underlying controls color where it is transparent

柔情痞子 提交于 2019-12-22 01:08:17
问题 I'm trying to draw a texture on texture as show in the image below. Yellow circle Image: Green circle Image: As shown in the above image of penguins, i'm trying to render another image as texture which is shown by green and yellow circles. The image is transparent where purple is shown. Purple is color of the underlying control on which the texture is drawn. The order of rendering is: 1. render penguins 2. Render green circle 3. render yellow circle 4. render green circle Now I'm not sure as

After Writing to a RenderTarget, How to Efficiently Clone the Output?

天大地大妈咪最大 提交于 2019-12-19 15:58:32
问题 XNA noob here, learning every day. I just worked out how to composite multiple textures into one using a RenderTarget2D. However, while I can use the RenderTarget2D as a Texture2D for most purposes, there's a critical difference: these rendered textures are lost when the backbuffer is resized (and no doubt under other circumstances, like the graphics device running low on memory). For the moment, I'm just copying the finished RenderTarget2D into a new non-volatile Texture2D object. My code to

Textures not drawing if multiple EAGLViews are used

僤鯓⒐⒋嵵緔 提交于 2019-12-14 03:48:35
问题 I'm having a bit of a problem with Apples EAGLView and Texture2D. If I create an instance of EAGLView and draw some textures, it works great. However, whenever I create a second instance of EAGLView, the textures in the new view(s) aren't drawn. Being new to OpenGL, I've got absolutely now clue as to what is causing this behavior. If somebody would like to help, I've created a small project that reproduces the behavior. The project can be found at http://www.cocoabeans.se/OpenGLESBug.zip Many

Optimization for changing pixels of sprite in Unity3D

放肆的年华 提交于 2019-12-13 20:13:09
问题 Problem : After a month, I'm coming back to the prototype for painting on sprite for my mini game. As you see in this thread I've figured out the solution for painting on sprite and because of big nested loop in the script, the mini game isn't at the good situation (I mean low FPS). So I've tried to use another method instead of Texture2D.SetPixel() then I used Texture2D.SetPixels() but like before the FPS was low. So right now, I don't find any solutions for this problem. Last thing which