• entries
    422
  • comments
    1540
  • views
    488696

Jack ONE, ATI ZERO

Sign in to follow this  
jollyjeffers

65 views

Given that I'm writing up various algorithms for my section of the book I figure it's important to know how and why they work. How else am I supposed to explain them to other people if I don't? Which, despite being convenient, means copy-n-paste programming is out of the window [headshake]

Not that I ever liked copy-n-paste programming it is sometimes useful when doing shader programming as you occasionally hit those nuggets of magical mathematical goodness that just don't seem to make any sense yet produce the correct results...

So my hybrid Relief Mapping / Steep Parallax Mapping / Parallax Occlusion Mapping shader is mostly finished now. Although there is one issue still outstanding...

Anyway, point of this entry... my implementation generates the same image as ATI's ParrallaxOcclusionMapping demo from the DirectX SDK. ATI's code takes 57 instruction slots and mine takes 52 [razz][razz]

Sign in to follow this  


5 Comments


Recommended Comments

Guest Anonymous Poster

Posted

Both are in shader model 3.0? In which case, is yours really faster?

I was wondering if the number of instruction slots reported by fxc may not be the best indicator for the shader being optimal since both nvidia and ati drivers should optimize the shaders further at runtime.

Share this comment


Link to comment
Hi Jack,

IIRC, the SDK demo has a built in bump mapping LOD system. I assume you removed that when doing the comparison? If so, that's is really cool that you were able to do better than someone with an entire gpu company standing behind them...

I am still looking forward to the book - good luck on the remainder of your writing!

Share this comment


Link to comment
Thanks for the comments!

Quote:
may I introduce the next chief engineer of ATI!
[lol] I wish!

Quote:
Both are in shader model 3.0? In which case, is yours really faster?
Both are in shader model 4.0, I've not actually checked if mine is different speed-wise as they're both running under the reference rasterizer and i'm not convinced its a good way of benchmarking...

I do notice that my code has more instructions inside a dynamic loop/branch which could either be a good or a bad thing - entirely depends how good the underlying architecture is at such things.

Quote:
the SDK demo has a built in bump mapping LOD system. I assume you removed that when doing the comparison?
I completely gutted the SM3/D3D9 demo that came with the SDK. I just took out the bare minimum to do POM and dropped it into a ps_4_0 shader. I wanted a couple of reference shaders so that I could verify my own implementation, so its essentially cut-n-paste.

Quote:
If so, that's is really cool that you were able to do better than someone with an entire gpu company standing behind them
Hence the 'smug grin' comment at the end of my journal [grin]

Although, in fairness to ATI/AMD, there is a comment at the top of the shader saying its not intended to be an optimal/production shader and is written for ease of understanding and educational purposes. I'm pretty sure they could still beat me (easily) if they wanted to write an optimal shader!

Cheers,
Jack

Share this comment


Link to comment
Quote:
Although, in fairness to ATI/AMD, there is a comment at the top of the shader saying its not intended to be an optimal/production shader and is written for ease of understanding and educational purposes. I'm pretty sure they could still beat me (easily) if they wanted to write an optimal shader!

this is correct a lot of the amd / nvidia code is just thrown together to give u an idea of whats possible easily seen by the large number of code warnings etc when u compile the examples, or stuff that is recomputed every frame instead of caching the results. ( this was my impression a couple of years ago perhaps this has improved )
nice going anyways jack

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now