Update: I've added support for Pixel Shader 2.0a and 2.0b in order to support more graphics cards. [Standard PS2.0 - without the 'a' or 'b' - is not supported due to instruction limits]
NOTE: This demo requires a fairly recent graphics card - it must support Pixel Shader 3.0, Pixel Shader 2.0b or Pixel Shader 2.0a.
Also, I'd appreciate it if people could post Min/Max frames-per-second numbers (from the caption bar of the window) and the make of their video card (from the console output) so I tweak the next version of the demo.
Readme from the demo:
This is a demo of hardware ray tracing using the Irrlicht 3D Engine. It is a modified version of the original nVidia demo.
The scene is rendered by drawing a viewport-sized quad (two triangles) and "tracing" a ray from the viewpoint through each pixel in the quad. The Pixel Shader calculates the intersection of each ray with primitives in the scene, determines the "closest hit" and then calculates the colour of the given pixel. Reflections are handled by tracing another ray from the intersection point into the scene.
The original demo hard-coded the scene objects into the shader; this demo uses Irrlicht scene nodes for the scene objects (spheres and light) and Irrlicht SceneNodeAnimators for animating the scene nodes. Shader constants are gathered for each scene node every frame and uploaded to the pixel shader for calculation of the scene. In addition, the light position is animated in this demo - in the original demo it was not (light position was a shader constant).
Updated: Added support for Pixel Shader 2.0a and 2.0b.
Usage
=====
Move mouse to alter viewpoint.
WASD keys to move camera.
Alt-F4 or Escape key to exit.
Requirements
============
Drivers:
Latest DirectX 9.0b drivers [www.microsoft.com/directx],
Latest DirectX9 drivers for your graphics hardware [from your HW vendor].
Graphics hardware with support for:
Vertex Shader 2.0, 3.0 or better
Pixel Shader 2.0a, 2.0b, 3.0, or better.
Notes
=====
This demo may require the Visual Studio 2005 Redistributable Files installed on your machine. These can be obtained from http://www.sio2.g0dsoft.com in the "Misc" section in "Downloads".
Last edited by sio2 on Wed Jan 24, 2007 6:19 pm, edited 1 time in total.
call this picking a nit, but the first thing I noticed about that excellent screenshot is how the reflection of the blue ball in the green ball did not show the secondary reflection of the floor, and vice-versa. I imagine doing that would require multiple passes?
just a funny thing i noticed, not really a criticism at all. this is a really neat demo.
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
sio2 wrote:
Also, I'd appreciate it if people could post Min/Max frames-per-second numbers (from the caption bar of the window) and the make of their video card (from the console output) so I tweak the next version of the demo.
If start prorgam and do not move the camera:
Min: 65 fps
Max: 99 fps
Video Card: Geforce 6600GT (AGP8x )
P.S.: i guess number of polygons on the spheres takes so much processor time.
buhatkj wrote:call this picking a nit, but the first thing I noticed about that excellent screenshot is how the reflection of the blue ball in the green ball did not show the secondary reflection of the floor, and vice-versa. I imagine doing that would require multiple passes?
just a funny thing i noticed, not really a criticism at all. this is a really neat demo.
It's only three spheres and a light and the pixel shader is already 327 instruction slots. Pluc, compiling the HLSL at runtime was so slow (about a second) that I now compile the HLSL file in VS2000 (in a pre-build step) and get the app to load the resultant PS3 asm file.
I could easily add more stuff, but I wanted an idea of how it ran on others' PS3 hw first.
(as shown on console) Radeon X1900 Series ati2dvag.dll 6.14.10.6648
(in real ) Asus Radeon EAX1900XT
FPS:
Min: 700
Max: 726
Bye!
Thanks for the feedback. Very interesting. Basically twice the PS3 power of my 7800GTX in this demo. Could also be your GPU takes advantage of the early-outs in the shader. Also I could not compile the shader with nvidia-helping partial-precision - without the precision the scene looked moire (ATI cards ignore partial-precision instruction modifiers and always full precision).
greenya wrote:
If start prorgam and do not move the camera:
Min: 65 fps
Max: 99 fps
Video Card: Geforce 6600GT (AGP8x )
P.S.: i guess number of polygons on the spheres takes so much processor time.
Thanks for the feedback. That's very interesting! I'd glad I didn't the extra reflections that buhatkj was nit picking about - it would probably have killed performance on your gpu.
By the way, there are zero polygons in the scene - it's ray tracing. The sphere primitives exists only as a point in 3D space and a radius (plus diffuse, specular and reflectance values).
Also, the gating feature of this demo is the gpu (graphics card) - it really taxes your pixel shader capability.
I'm going to try and squeeze out a PS2.x version. As is, there's too many pixel shader instructions for 2.x; I may have to cut out the texture or one of the three spheres.
I aim to use this as part of benchmarking for my game. It'll help me decide default quality settings.
Err..replying to my own request for fps numbers...
ATI 1800XL Min=266, Max=277. Pointing the camera at "nothing"=523, filling the window with the scene=197.
Note: there are some early-outs (dynamic branching) in the pixel shader, so the less scene objects there are in the window the less the shader has to do. This explains the variation in fps.
Also, those ATI 1900 cards seem a bit faster than the ATI 1800 cards.