So basically each value is:Īnd using some macro foo, I can do something like
That way I don't need to manage this texture for looking up the properties. Originally I though oh, maybe I'll store each value as 4 Vector4's, and do some macro foo to select the proper value from the arrays via index. For instance, in MicroSplat, which at the time only supported 16 textures (now 32), I thought I'd switch back to properties. I've also found really oddball things with using arrays in shaders. My guess is that at some point fetching from where that data is stored is slower than looking in a small texture which is heavily cached. Besides there being no good way to store this data with the material other than a texture (Unity doesn't support array properties), setting them on the material and looking them up seemed to be slower than using a texture. How can I achieve to getting the pixel shadered photo texture in its original size back? I would like to achieve the same result as Shazzam Tool delivers, but without WPF.There's kind of a cross over point though- In MegaSplat I have the problem of needing to store many per-texture properties for 256 textures. This code doesn't fit my needs, since it captures the whole scene and not only the texture (=photo). I would like to achieve similar effects like the Shazzam Tool delivers out of the box with its example library - unfortunately I'm using pure GDI+ and no WPF.įor creating image effects in a GDI+ bitmap I thought of the following steps:Ģ) Init DirectX, load/compile shader, convert GDI+ image to be used as texture in DirectXģ) Draw 4 vertices in DirectX and use the photo as textureĥ) Save the surface with the pixel shadered photoġ-4 is already solved, but how do I achieve step 5?Ĭurrently I'm using the following snippet for gathering the modified photo: d3dDevice->GetRenderTarget(0, &surface) ĭ3DXSaveSurfaceToFile("Test.png", D3DXIFF_PNG, surface, NULL, NULL) It utilizes GDI+ for image processing and I want to offer the user some fancy image effects - which I would like to do via DirectX pixel shaders.
Is it possible to use DirectX pixel shaders to create image effects for photos? I have a C++ application which includes kind of a photo database manager.