texture2d

SharpDX load a texture in Windows Phone 8

天涯浪子 提交于 2019-12-11 07:42:55
问题 I'm creating a Windows Phone 8 app and I'm using SharpDX to load a texture. I've tried to load PNG using Content.Load<Texture2D>("filename.png") but I've got errors and I've realized that SharpDX in Windows Phone 8 only accepts DDS textures and doesn't accept PNG/JPEG/BMP etc. I've converted my PNG to DDS using texconv filename.png and added the file to my solution just like other files that I'm using in my project (that I can load correctly). When I run my app, I'm getting an exception:

Three.JS: Gaussian blur in GLSL shader

本秂侑毒 提交于 2019-12-11 06:04:07
问题 I have this vert/frag shader, which is using vertex data and two textures. I am trying to apply post blur effect, but having only rectangles after it. vert: attribute float type; attribute float size; attribute float phase; attribute float increment; uniform float time; uniform vec2 resolution; uniform sampler2D textureA; uniform sampler2D textureB; varying float t; void main() { t = type; vec4 mvPosition = modelViewMatrix * vec4(position, 1.0 ); if(t == 0.) { gl_PointSize = size * 0.8; }

How does XNAs Content.Load<Texture2D> operate?

Deadly 提交于 2019-12-11 03:43:47
问题 I'm just curious if it actually loads the asset into memory every time it's called or if it looks it up, finds if it's loaded and if it isn't loaded it loads it once and just keeps references so the second time it's called it just grabs a reference to it? 回答1: It keeps track of what has already been loaded, and simply returns a reference to the same object if it has been loaded before (this is per-ContentManager). This applies to all content, not just textures. The upshot is that you can just

DirectX newb - Multisampled Texture2D with depth on a Billboard

谁说胖子不能爱 提交于 2019-12-11 02:46:10
问题 Here's my requirement: Using DirectX11 (via SlimDX) I have to download a series of verteces and use them to create a Texture2D of a map of county borders. Then I need to do the same thing with state borders, and draw them over the county borders. Then, I need to take that texture and create 2 different textures from it, each containing unique radar data. Then I want to take those textures and display them so that the user can look at, for example, base reflectivity and base velocity side by

GLSL textureCube and texture2D in same shader

让人想犯罪 __ 提交于 2019-12-11 01:12:40
问题 I can't seem to be able to have both texture2D() and textureCube() in one shader. When I do, nothing shows up and there is no error. I tried this both with my own shader loader and the Apple GLSL shader builder and the same thing happens. It happens even if I have textureCube() in the vertex shader and texture2D() in the fragment. They seem to work fine by themselves, but as soon as they're called together, no matter in which order, nothing shows up. 回答1: You need to bind both textures as

Problems to understand DXGI DirectX 11 Desktop Duplication to get a Buffer or Array

北城以北 提交于 2019-12-10 11:56:06
问题 I want to understand DXGI Desktop Duplication. I have read a lot and this is the code I copied from parts of the DesktopDuplication sample on the Microsoft Website. My plan is to get the Buffer or Array from the DesktopImage because I want to make a new Texture for an other program. I hope somebody can explain me what I can do to get it. void DesktopDublication::GetFrame(_Out_ FRAME_DATA* Data, _Out_ bool* Timeout) { IDXGIResource* DesktopResource = nullptr; DXGI_OUTDUPL_FRAME_INFO FrameInfo;

ReadPixels was called to read pixels from system frame buffer, while not inside drawing frame. UnityEngine.Texture2D:ReadPixels

本小妞迷上赌 提交于 2019-12-08 08:18:01
问题 I'm trying to create a little test app, using unity. I'm building out one instance of the app and setting it to function as a Host and then running another instance within the unity editor as a client. In this current iteration I have a single button that SHOULD, when pressed is take a screenshot and then send that screenshot to all clients. But nothing seems to to be working. The initial issue that I'm hitting is a ReadPixels error: ReadPixels was called to read pixels from system frame

generate texture from array in threejs

江枫思渺然 提交于 2019-12-08 06:54:38
问题 I am trying to generate a texture from an array in threeJS and it is not working as expected. It appears that the way I generate the texture is not correct. If I use the following texture, it works as expected. http://www.html5canvastutorials.com/demos/assets/crate.jpg crateTex = THREE.ImageUtils.loadTexture('data/crate.jpg'); If I generate a dummy texture and try to display it, it is all black... var dummyRGBA = new Uint8Array(4 * 4 * 4); for(var i=0; i< 4 * 4; i++){ // RGB from 0 to 255

What is the correct Resource.Load path?

ぃ、小莉子 提交于 2019-12-07 12:18:08
问题 I'm trying to load a Texture2D (.png) resource using Resource.Load. I've tried following path patterns: Assets/CaseSensitivePath/TextureName CaseSensitivePath/TextureName Assets/CaseSensitivePath/TextureName.png CaseSensitivePath/TextureName.png Every time, Resource.Load(path, typeof(Texture2D)) returns null. This is my code and error handling: public class LazyResource<T> where T : UnityEngine.Object { //Path is read-only public string path { get { return _path; } } private string _path = ""

ReadPixels was called to read pixels from system frame buffer, while not inside drawing frame. UnityEngine.Texture2D:ReadPixels

泪湿孤枕 提交于 2019-12-06 16:55:23
I'm trying to create a little test app, using unity. I'm building out one instance of the app and setting it to function as a Host and then running another instance within the unity editor as a client. In this current iteration I have a single button that SHOULD, when pressed is take a screenshot and then send that screenshot to all clients. But nothing seems to to be working. The initial issue that I'm hitting is a ReadPixels error: ReadPixels was called to read pixels from system frame buffer, while not inside drawing frame. UnityEngine.Texture2D:ReadPixels(Rect, Int32, Int32) UNETChat