mrvux / dx11-vvvv

DirectX11 Rendering within vvvv
Other
72 stars 71 forks source link

ConstantProjection has incorrect shift in World #280

Open mediadog opened 7 years ago

mediadog commented 7 years ago

Discussed on the vvvv forum, filing what I think is a bug here. ConstantProjection when set to World does not match the DX9 version, ProjectedTexture, the texture is offset. The problem appears to be in the pixel shader

This line:

In.TexCd.xy=In.TexCd.xy/In.TexCd.w*float2(1,-1)+0.5;

has that offset at the end unlike the DX9 version. When changed to this:

In.TexCd.xy=In.TexCd.xy/In.TexCd.w;

then it does a correct world projection and matches the DX9 shader.

See example patch: ProjectionComparison.zip

antokhio commented 7 years ago

The problem isn't in the shader see https://discourse.vvvv.org/t/projectedtexture-dx11/14546/4