• Create Account

### #ActualL. Spiro

Posted 28 July 2012 - 04:49 AM

What do you mean by compressed textures? Using them in .jpg format?

That is a disk compression compression format.
I am talking about run-time compression formats such as DXT, BCn, etc.
http://wiki.polycount.com/DXT
http://msdn.microsof...531(VS.85).aspx

You suggest to spilt the vertexbuffer, setting one only once (x + z), then pass a y-buffer every chunk?

I do. In addition to compressing the X and Z values to 16 bits.

I only set one set of textures once per frame for the terrain at the moment.

The way you are setting them is not efficient.
Why not:
ID3D11ShaderResourceView * psrvViews[] = {
slopeTexture,
rockTexture,
grassTexture
};
d3d11DevCon->PSSetShaderResources( 0, 3, psrvViews );

And furthermore, if terrain is the only thing you are drawing, those textures will already be set, so setting them again and again is just wasting time.
You need to make wrappers for basically all of the DirectX 11 calls and check the last values you sent to them, and when matching, don’t call the DirectX 11 function.
Sorting by render states, textures, and shaders only has meaning if you are doing this.

L. Spiro

### #1L. Spiro

Posted 28 July 2012 - 04:48 AM

What do you mean by compressed textures? Using them in .jpg format?

That is a disk compression compression format.
I am talking about run-time compression formats such as DXT, BCn, etc.
http://wiki.polycount.com/DXT
http://msdn.microsoft.com/en-us/library/bb694531%28VS.85%29.aspx

You suggest to spilt the vertexbuffer, setting one only once (x + z), then pass a y-buffer every chunk?

I do. In addition to compressing the X and Z values to 16 bits.

I only set one set of textures once per frame for the terrain at the moment.

The way you are setting them is not efficient.
Why not:
ID3D11ShaderResourceView * psrvViews[] = {
slopeTexture,
rockTexture,
grassTexture
};
d3d11DevCon->PSSetShaderResources( 0, 3, psrvViews );

And furthermore, if terrain is the only thing you are drawing, those textures will already be set, so setting them again and again is just wasting time.
You need to make wrappers for basically all of the DirectX 11 calls and check what the last values you sent to them, and when matching, don’t call the DirectX 11 function.
Sorting by render states, textures, and shaders only has meaning if you are doing this.

L. Spiro

PARTNERS