File under: Development, crtrm, c, specular, pictures

blog / Specular Materials

Adding specular materials to crtrm

I've been putting some time into reworking the materials code for crtrm. Well, that's a bit inaccurate - I've added materials code. Previously, changing the material involved editing code in the rendering loop, which could reasonably described as "less than ideal". So I've pulled all that materials-related code out into its own module, and indexed all the materials I was using so I can now have a mapping from model id number to material id number. This will eventually lead to having a user-friendly editor where you will be able to select different materials from drop down menus and apply them to the models you are designing. In real time, of course. If you have a 32-core machine. With 16Ghz cores.

That'll take a while, so for now enjoy some pictures of the fancy new materials code in action.

Diffuse + Specular

Specular and Diffuse

Mostly Specular (with a glaze shader)

Specular Glaze

Shadows

Not a new feature, but it'll do for now.

Specular Glaze with Shadows

It's really starting to bother me that I can't see the reflections of the spikes in the specular highlight. Now that I have the main loop refactored, I should be able to handle reflections easily enough. The challenge is to handle them efficiently.

Bonus

I spent ages trying to get this picture to work, but I couldn't get the right angle for it. Now I'm not even sure why I thought adding a ring around it would be cool. Everybody likes rings, right?

SpikeBall and Ring

Maybe if I rotate it...

SpikeBall and Ring Rotated

Nah