texture2d

Render an outlined red rectangle on top a 2D texture in OpenGL

给你一囗甜甜゛ 提交于 2019-12-02 13:01:05
问题 I have searched alot this site but couldn't exactly find what is exactly my problem. Most of the similar problems had used console and the glut library. But since I'm new to OpenGL and MFC and started it with the combination of MFC, they couldn't help me alot. I'm customizing the class COpenGLcontrol here in codeguru for my own purposes. Here's the full customized class but if you're not interested in downloading it, no problem I will explain the parts that are related. This may take a while,

Painting sprite in unity

半城伤御伤魂 提交于 2019-12-02 07:32:23
问题 Problem : I want to make prototype for cleaning windows (I mean cleaning dirty windows) in unity. I was searching about this subject and finding that I can change pixel by Texture2D.SetPixel() . I try to do it by this method, First I enabled read/write of texture and try this method but nothing happened on my sprite. So I want to ask it if it's possible to change alpha of the sprite that is clicked by mouse or touched to show the below sprite of original one !? My Code : private RaycastHit2D

Render an outlined red rectangle on top a 2D texture in OpenGL

亡梦爱人 提交于 2019-12-02 06:30:32
I have searched alot this site but couldn't exactly find what is exactly my problem. Most of the similar problems had used console and the glut library. But since I'm new to OpenGL and MFC and started it with the combination of MFC, they couldn't help me alot. I'm customizing the class COpenGLcontrol here in codeguru for my own purposes. Here's the full customized class but if you're not interested in downloading it, no problem I will explain the parts that are related. This may take a while, so I hope you will be patient! First of all I should tell you that my goal of drawing such a rectangle

Painting sprite in unity

对着背影说爱祢 提交于 2019-12-02 02:47:48
Problem : I want to make prototype for cleaning windows (I mean cleaning dirty windows) in unity. I was searching about this subject and finding that I can change pixel by Texture2D.SetPixel() . I try to do it by this method, First I enabled read/write of texture and try this method but nothing happened on my sprite. So I want to ask it if it's possible to change alpha of the sprite that is clicked by mouse or touched to show the below sprite of original one !? My Code : private RaycastHit2D hitInfo; private SpriteRenderer spriteRendererComponent; private Color zeroAlpha; // Use this for

Possible to glTexImage2d an NPOT image onto a Pow-2 texture without extra allocation?

好久不见. 提交于 2019-12-01 13:55:21
I have discovered that there are still a fair number of drivers out there that don't support NPOT textures so I'm trying to retro-fit my 2D engine (based on OpenTK, which is in turn based on OpenGL) with Texture2D support instead of relying on GL_ARB_texture_rectangle. As part of this I am forcing all NPOTS texture bitmaps to allocate extra space up to the next power-of-2 size so they won't cause errors on these drivers. My question is, do I really have to resize the real bitmap and texture and allocate all that extra memory, or is there a way to tell OpenGL that I want a power-of-2 size

Possible to glTexImage2d an NPOT image onto a Pow-2 texture without extra allocation?

本小妞迷上赌 提交于 2019-12-01 13:32:16
问题 I have discovered that there are still a fair number of drivers out there that don't support NPOT textures so I'm trying to retro-fit my 2D engine (based on OpenTK, which is in turn based on OpenGL) with Texture2D support instead of relying on GL_ARB_texture_rectangle. As part of this I am forcing all NPOTS texture bitmaps to allocate extra space up to the next power-of-2 size so they won't cause errors on these drivers. My question is, do I really have to resize the real bitmap and texture

Non-blocking loading and copying of large Texture2D's in C# for Unity

梦想的初衷 提交于 2019-11-30 19:36:46
I'm building a Unity app for Android which deals with loading a lot of large textures dynamically (all images are over 6MB in size as png's). These textures can either come from an Amazon S3 server, in which case they arrive as a stream, or from the user's device itself. In both cases I'm able to get hold of the raw data or texture asynchronously without a problem. In the first I query the server and get a callback with the stream of data, and in the second I use the WWW class to get hold of the texture making use of the "file://" protocol. The problem happens as soon as I want to copy this

Rendering SurfaceTexture to Unity Texture2D

主宰稳场 提交于 2019-11-30 10:16:05
I came up with simillar questions earlier, but they weren't good clarified and right now I would like to take an advice what's wrong I'm doing in my code. So what I'm trying to do is rendering SurfaceTexture from Android plugin to Unity Texture2D. Here's my Unity code: public class AndroidHandler : MonoBehaviour { [SerializeField] private RawImage _rawImage; private Texture2D _inputTexture; private AndroidJavaObject androidStreamerObj; private System.IntPtr _nativePtr; void Start () { _rawImage.material.SetTextureScale("_MainTex", new Vector2(-1, -1)); InitAndroidStreamerObject(); } private

Vulkan texture rendering on multiple meshes

末鹿安然 提交于 2019-11-30 07:14:37
问题 I am in the middle of rendering different textures on multiple meshes of a model, but I do not have much clues about the procedures. Someone suggested for each mesh, create its own descriptor sets and call vkCmdBindDescriptorSets() and vkCmdDrawIndexed() for rendering like this: // Pipeline with descriptor set layout that matches the shared descriptor sets vkCmdBindPipeline(...pipelines.mesh...); ... // Mesh A vkCmdBindDescriptorSets(...&meshA.descriptorSet... ); vkCmdDrawIndexed(...); //

Non-blocking loading and copying of large Texture2D's in C# for Unity

眉间皱痕 提交于 2019-11-30 03:09:54
问题 I'm building a Unity app for Android which deals with loading a lot of large textures dynamically (all images are over 6MB in size as png's). These textures can either come from an Amazon S3 server, in which case they arrive as a stream, or from the user's device itself. In both cases I'm able to get hold of the raw data or texture asynchronously without a problem. In the first I query the server and get a callback with the stream of data, and in the second I use the WWW class to get hold of