Just a short note this one to point out a link I find very interesting. Entitled "The Scale of the Universe" by Cary Huang it's a fascinating interactive exploration of the relative sizes of all manner of entities in the Universe.
The Scale of the Universe
Maybe it's just me, but I find zooming in and out and clicking on the different entities for extra information strangely compulsive...
Charting my attempts to create a procedural Universe and other random thoughts...
Monday, February 27, 2012
Wednesday, February 22, 2012
Understanding BCn Texture Compression Formats
Texture compression can be something of a black box with many people happy to just "turn it on" to save memory or increase performance and think little else about it, but in practice the different DXT compression formats that have been available in DirectX for years have significant behavioural characteristics that can make a radical difference to the visual quality of a project.
More recently DX10 and DX11 have brought in even more choice with the replacement of the DXT formats with no less than seven flavours of block compression, conveniently known as BC1 to BC7 making the choice of texture storage format even more significant to achieve best quality visual results.
While the DirectX documentation on these formats is technically rich, it's not the clearest introduction to the formats and doesn't always make it clear which is best for what purpose and why - fortunately though graphics programmer Nathan Reed has kindly taken the time on his blog recently to fill that gap with a clear explanation of the different BC formats.
So if you are interested in texture compression or just want to make sure you're making the most of your carefully crafted DX10/11 project's visuals I suggest giving his excellent article a read:
Understanding BCn Texture Compression Formats
More recently DX10 and DX11 have brought in even more choice with the replacement of the DXT formats with no less than seven flavours of block compression, conveniently known as BC1 to BC7 making the choice of texture storage format even more significant to achieve best quality visual results.
While the DirectX documentation on these formats is technically rich, it's not the clearest introduction to the formats and doesn't always make it clear which is best for what purpose and why - fortunately though graphics programmer Nathan Reed has kindly taken the time on his blog recently to fill that gap with a clear explanation of the different BC formats.
So if you are interested in texture compression or just want to make sure you're making the most of your carefully crafted DX10/11 project's visuals I suggest giving his excellent article a read:
Understanding BCn Texture Compression Formats
Wednesday, February 8, 2012
More on Floating Point Precision
I read an interesting article on the excellent #AltDevBlogADay site the other day entitled "dont-store-that-in-a-float" - a brief but clear and informative discussion on the perils of precision with single precision floating point numbers.
I would recommend a read of this to anyone experimenting with projects similar to my own as this is a key issue to the simulation and rendering of planetary and solar bodies due to the combination of immense and tiny distances that need to be represented - at times simultaneously.
Understanding how floats deal with and represent precision certainly pays dividends when trying to work out why things are clipping or popping around the screen when they really ought not to be!
I would recommend a read of this to anyone experimenting with projects similar to my own as this is a key issue to the simulation and rendering of planetary and solar bodies due to the combination of immense and tiny distances that need to be represented - at times simultaneously.
Understanding how floats deal with and represent precision certainly pays dividends when trying to work out why things are clipping or popping around the screen when they really ought not to be!
Friday, January 27, 2012
Ducks and Dogs
Not a feature update today, more of a thought-of-the-day(tm):
I spent quite a few hours the other day trying to work out how a specific texture in my project was apparently being point sampled while others using the same sampler states were being tri-linear filtered as they should have been. I tried using Pix to determine just what state the GPU was in but without much success - Pix doesn't seem to like my project very much.
This led on to much poking around and experimental changes looking for more evidence that might point to the underlying problem. It turned out in the end however to be nothing to do with samplers or really DirectX at all – there was a bug elsewhere in the C++ code that generates the texture co-ordinates for the geometry in question which was causing it to make them offset massively from the origin, which in turn led to a catastrophic loss of precision in the GPU interpolators creating the point sampled effect I was seeing.
Usually having stupid (u,v) values causes texture wriggling or shimmering either of which would have given the game away immediately but in this particular case it happened to make the texture look perfectly stable but point sampled.
The moral? Try to avoid myopia when tracking down bugs – just because it looks like a duck and quacks like a duck doesn't necessarily mean it really is a duck - it might just be a dog.
I spent quite a few hours the other day trying to work out how a specific texture in my project was apparently being point sampled while others using the same sampler states were being tri-linear filtered as they should have been. I tried using Pix to determine just what state the GPU was in but without much success - Pix doesn't seem to like my project very much.
This led on to much poking around and experimental changes looking for more evidence that might point to the underlying problem. It turned out in the end however to be nothing to do with samplers or really DirectX at all – there was a bug elsewhere in the C++ code that generates the texture co-ordinates for the geometry in question which was causing it to make them offset massively from the origin, which in turn led to a catastrophic loss of precision in the GPU interpolators creating the point sampled effect I was seeing.
Usually having stupid (u,v) values causes texture wriggling or shimmering either of which would have given the game away immediately but in this particular case it happened to make the texture look perfectly stable but point sampled.
The moral? Try to avoid myopia when tracking down bugs – just because it looks like a duck and quacks like a duck doesn't necessarily mean it really is a duck - it might just be a dog.
Subscribe to:
Posts (Atom)