Friday, April 29, 2011

Changelog 001

This was a quite successful week. I've learned a lot of things and started implementing them aswell.

The first thing i worked on was finally getting the per pixel lighting shader to work, which i did after numerous talks with several developers both on and irc. Eventually, all that was left to do was transforming the lights position by the camera matrix, so everything is in the same view space, and can be lit accordingly.

Failed lighting
Successful lighting
Currently it is only using diffuse lighting. Adding ambient and specular would be easy but it is not necessary right now, as for now i just like to tinker around with shaders and to get a better understanding of how to work with them.

Another thing i wanted to get done for month is model loading, and thus i started coding a collada importer. For now it is crudely hacked together, and it only supports triangulated models and no quads or other polygons. It took a couple of hours but eventually i got it working pretty good.

Quick and dirty model made in blender

I added another shader for texturing which includes the lightingcode from before and shaders really are awesome to work with!

Lastly, i want to give some credits to iq of rgba for writing this awesome shader live editor.
Something like this would really increase the workflow, and instead of alt-tabbing and recompiling all the time you just hit a button and see the results. So this encouraged me to remake this idea and write my own shader live editor. It took just a few hours, but for now it is more of a proof of concept. The editing capabilities are crude, but at least it is working!

I will keep working on it to make it a useful and fun tool eventually.

No comments:

Post a Comment