Ray traced billiard balls

I am having a lot of fun developing my pool game.

The standard environment mapping technique doesn’t work well for very close reflections like these because you sample the cube map using the reflected ray originating at the center of the cube map, instead of originating from the pixel being lit.

I used same code from my virtual room technique to ray trace from the pixel to the cube map, video here:

Edit: now implemented virtual spheres using 2 triangles per sphere:

Each ball has its own cube map.

This puts a heavy load on the system so I am planning a queuing system that uses occlusion queries to process the most visible balls first, and some trigonometry to calculate the most visible cube map faces also.

And now for dual cube maps (notice the reflections in the reflections …)

My understanding of the cube map problem:

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: