Updated: Hardware RayTracing Demo

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Updated: Hardware RayTracing Demo

Post by sio2 »

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]

I've just added another Irrlicht demo to my website: http://sio2.g0dsoft.com

Image

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.
buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

nit picking

Post by buhatkj »

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
ct-informatik
Posts: 5
Joined: Mon Jan 22, 2007 8:12 pm
Location: Ludwigshafen, Germany
Contact:

Post by ct-informatik »

Hi!

GC:
  • (as shown on console) Radeon X1900 Series ati2dvag.dll 6.14.10.6648
    (in real :wink:) Asus Radeon EAX1900XT
FPS:
  • Min: 700
    Max: 726
Bye! 8)
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Re: Hardware RayTracing Demo

Post by greenya »

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.
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

Excellent one. :D
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Re: nit picking

Post by sio2 »

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.
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

ct-informatik wrote:Hi!

GC:
  • (as shown on console) Radeon X1900 Series ati2dvag.dll 6.14.10.6648
    (in real :wink:) Asus Radeon EAX1900XT
FPS:
  • Min: 700
    Max: 726
Bye! 8)
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).
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Re: Hardware RayTracing Demo

Post by sio2 »

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. :wink:

By the way, there are zero polygons in the scene - it's ray tracing. :mrgreen: 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. 8)
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Wow! Amazing! I wish I had PS3...
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

BlindSide wrote:Wow! Amazing! I wish I had PS3...
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. :P

I aim to use this as part of benchmarking for my game. It'll help me decide default quality settings.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Hehe actually, I took out my ATI card for an mx440 so I have NO pixel shaders :P

But I am getting a newer one soon! After seeing this I will aim for PS3+...
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

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. :wink:

Also, those ATI 1900 cards seem a bit faster than the ATI 1800 cards. :wink:
RapchikProgrammer
Posts: 279
Joined: Fri Dec 24, 2004 6:37 pm

Post by RapchikProgrammer »

Im still on radeon 9250, so still hung at 1.4, but already ordered a 7300gt, hope to get it in a coupl o weeeks!
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

I've just managed to squeeze it into Pixel Shader 2.0a (note the 'a') with some real heavy hammer work. :twisted: I'll post an updated demo soon.

Unfortunately, it just wont fit "as is" in PS2.0 (note - no 'a'), there's just not enough registers. Maybe if I cut something out...

It interesting that the same shader is twice as fast in PS3.0 as PS2.0a on a 7800GTX.
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

RapchikProgrammer wrote:Im still on radeon 9250, so still hung at 1.4, but already ordered a 7300gt, hope to get it in a coupl o weeeks!
The 9250 is PS1.4 and supports 22 instructions. My PS3.0 pixel shader is 327 instructions. :wink:

The 7300GT is SM3. Hopefully it will be a bit better than your 9250. :D
Post Reply