Forum

Texture Formates in TexturePlugins?

Hello,
can I somehow specify the Texture Format in a Texture Plugin? I use the Template and it outputs a A8R8G8B8 Texture, I would prefer a greyscale Tex.
Was looking in TextureResource but I did not find anything.

Thanks

You’ll need to replace line 104 (TextureUtils.CreateTexture…) with a direct call to the constructor of a texture, which allows you to specify the texture format.

not directly. but:

see in the texturetemplate line 104 where it says:
return TextureUtils.CreateTexture(device, Math.Max(info.Width, 1), Math.Max(info.Height, 1));

this is calling:
https://github.com/vvvv/vvvv-sdk/blob/develop/vvvv45/src/core/Utils3rdParty/SlimDX/TextureUtils.cs#L45

where you see the format is being specified at line 55. so you instead of calling the TextureUtils.CreateTexture function you could take the code from that routine and specify your desired format. see?

Thanks guys, it works and it compiles, but if I connect it for example to a quad, i get a could not draw vertex buffer…

u do tfx for that normally

hard to guess from here then what this could be. can you upload your plugin so we can have a look?

Hey thanks for the help.

i was reading somewhere that some graphic devices have problems with this formats maybe that is the reason why its not working. on the other hand, I guess the ex9texture node does the same and its not crashing at all. What I am working on is a camera Plugin for the Allied Cams. It works pretty well besides this problem. What I try next is to output a CVImage instead of Ex9 Texture I will try to use Elliots PointGrey Code because it looks quit similar to what I have and he also gets a 8Bit_MonoTexture. I think its handy because if I output a Ex9 Texture and I wanna use OpenCV I have to converte to DX11 and than to CVImage not very elegant…

i guess you’ll get an easy job if you’re making it a dx11-texture