Pixel size resolution Dx11


#1

Hey
I need to display an image to its actual pixels dimension, I found this old post in the forum:

I took the patch posted by u7angel and tried to simply change everything with dx11 nodes but it’s not working in the same way, I don’t understand why is it so. There are other nodes in dx11 for this purpose?


#2

for dx11 you’ll need the PixelBillboard (DX11) node.


#3

see patch.
pxl.v4p (16.6 KB)


#4

Thanks @bjoern n for the useful comparative example.


#5

I like to use the approach bjoern suggested to the right.
It has quite some advantages I find …
While PixelBillboard will always enforce the actual size of the image, deriving the scaling from the Target Resolution yourself will keep everything in place in the correct ratio if you i.e. scale down your renderer while working (previewing a 4k output in a small window while keeping 16:9 aspect).
Other than that, while hidden Transform of PixelBillboard is not spreadable, the manual approach is.


#6

you can also use this in a shader to do pixel-precise stuff, i guess:

float2 R:TARGETSIZE;

iirc, this is the size of a pixel in relation to the width of the rendertarget


#7

Nope, that should be actual resolution of rendertarget in pixels, texelsize would be 1.0f/R then


#8

I think 1/R or texel size had a semantic too:
float2 foo: INVTARGETSIZE;


#9

Hi, i’m on the phone and can’t check any patch, so i may be out of topic…
But, just to know, if you are interested in a very raw way to display image pixels you could consider using the “Load” hlsl function instead of the “Sample” one to read data from the input texture.
Texture.Load(pixel coords)
You get Pixel coords using directly input.PosWVP coming from vertex shader.
…but i could be wrong, just going by memory…