Jump to content
  • Advertisement
Sign in to follow this  
Mick is Stumped


This topic is 2809 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I found an old thread (http://www.gamedev.net/community/forums/topic.asp?topic_id=185962) about D3DTSS_TCI_CAMERASPACEPOSITION... it sounds as if it works exactly as I'd like it to, but I'm not getting ideal results.

Basically I'm trying to backport a graphics framework to some legacy targets... D3D9 with only pixel shaders, D3D9 with no shaders, and D3D7.

I want to implement dithering because it's not supported by any modern hardware drivers (I've found)

Have dither working splendid under ps_3_0 via the vpos semantic. So I'm trying first to map D3DTSS_TCI_CAMERASPACEPOSITION to a pixel shader without a vertex shader bound.

What I get definitely looks dithered. So I'm assuming something is working. However while moving around very strange patterns appear here and there... often circular and checkered. The checkers come from not a 1:1 mapping with the dither texture point filtered. The circular warping I've no clue.

What I'd like is just each vertex to have a second texture coord generated which maps directly to screen space somehow. That sounds anyway exactly what this function is for, but it's just not what I'm seeing unfortunately.


Share this post

Link to post
Share on other sites

Setup looks like this.


Probably where I'm dumbfounded is I don't know what coordinates to actually expect in the shader. The docs usually say stuff like "clipping space" "camera space" etc, but never explicitly define that... not in the same place anyway.

Sans pshader the texture matrix will be a must, but just trying to get it working this way first.

Thanks again (anyone)

Share this post

Link to post
Share on other sites
With a little intuition I was able to stabilize things with...

float2 vpos = (In.uv1.xy/In.uv1.z*0.5f+0.5f)*dimViewport;

Changed D3DTTFF_COUNT2 to D3DTTFF_COUNT3 because the docs say D3DTTFF_PROJECTED is only honored by ps_1_x and the colours I was getting running some test patterns did not appear perspective corrected.

Still however the dither pattern does not appear ideal. It looks a little grainy/maybe stretched.

[Edited by - Mick is Stumped on November 13, 2010 3:19:37 AM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!