Multi-Texturing using single texture

Started by
0 comments, last by Dawoodoz 12 years, 1 month ago
Hi guys,

I have been able to significantly enhance the quality of a video stream over UDP using multi-texturing in a slightly tweaked manner.
I am creating one texture for the video and then assigning it to 4 different samplers. On every sampler I am using Anisotropic filtering.
Somehow 4 has turned out to be the magic figure. Below 4, there is still some aliasing and gas in texts, and above 4 there is no significant change in video quality.

PFB the code snippet (Pardon my laziness, I am yet to put this in a loop) :


.....
_pd3dDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
_pd3dDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
_pd3dDevice->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_ANISOTROPIC);
_pd3dDevice->SetSamplerState(0, D3DSAMP_MAXANISOTROPY, 4);
_pd3dDevice->SetTexture(0, textureFromChannel);
_pd3dDevice->SetSamplerState(1, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
_pd3dDevice->SetSamplerState(1, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
_pd3dDevice->SetSamplerState(1, D3DSAMP_MIPFILTER, D3DTEXF_ANISOTROPIC);
_pd3dDevice->SetSamplerState(1, D3DSAMP_MAXANISOTROPY, 4);
_pd3dDevice->SetTexture(1, textureFromChannel);
_pd3dDevice->SetSamplerState(2, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
_pd3dDevice->SetSamplerState(2, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
_pd3dDevice->SetSamplerState(2, D3DSAMP_MIPFILTER, D3DTEXF_ANISOTROPIC);
_pd3dDevice->SetSamplerState(2, D3DSAMP_MAXANISOTROPY, 4);
_pd3dDevice->SetTexture(2, textureFromChannel);
_pd3dDevice->SetSamplerState(3, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
_pd3dDevice->SetSamplerState(3, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
_pd3dDevice->SetSamplerState(3, D3DSAMP_MIPFILTER, D3DTEXF_ANISOTROPIC);
_pd3dDevice->SetSamplerState(3, D3DSAMP_MAXANISOTROPY, 4);
_pd3dDevice->SetTexture(3, textureFromChannel);

// Draw stream
_pd3dDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
.....

I am assuming 2 things here: 1) RAM is not a concern 2) Graphics card is not a concern

Of course, internet bandwidth is a major concern, but till now haven't faced any issues for speeds as low as 512 kbps.

I am just keen to know that what can be the possible negatives out of this approach.

thanks
Advertisement
I would define my own supersampling pattern in the shader for deterministic rendering since performance is not a problem.

This topic is closed to new replies.

Advertisement