Featured post

new redirect for blender.org bpy docs.

http://www.blender.org/api/blender_python_api_current/ As of 10/11 november 2015 we can now link to the current api docs and not be worr...

July 06, 2012

One last three.js webgl experiment for now

1. pre baked AO as a texture

semi low poly trumpet, will take a little while to load, the mesh is 11.6 MB (11,583,478 bytes) but the texture is only 700kb or something.

So this post will be added to over the next few days, and i will replace the texture with a material and maybe a bumpmap / specularity map /and see how for i can take three.js with my limited understanding of the technology.

2. pre baked AO as a vertex color map

With any luck this fantastic little Noiseless Ambient Occlusion Tool for Blender 2.6 script by scorpius will allow me to display a vertex color map instead of a texture. This will require some reading. So check back later

Running the addon on 11mb of geometry takes about the same amount of time as the baking onto a texture. The result looks really clean but my optimized geometry doesn't lend itself to the method - had I known this I would add extra loop cuts to certain areas to allow more localized shadows.

Even tho i'm not super happy with how it turned out i'll still attempt to get it working as a threejs/webgl thing. Here's a screenshot from blender - you can clearly see where i could add more geometry to facilitate the AO. but i won't :)


After some reading around it seems that the drivers for my (pretty outdated) graphics card don't support webgl on ubuntu. A couple of hours wasted. I've read issues about 9 months ago that vertex colours were not implemented in canvas renderer, yet i distinctly recall seeing the n-hedrons on this very screen at some point. For now, i wasted enough time on this.

3. RAWR!!!

Clearly i am a masochist in some form, eventually after returning to the latest examples on the three.js page the cube vertex colours example provided a ready-to-rock solution. I'm writing this on a windows machine which isn't my usual development environment, it seems firefox webgl is a lot faster - plus it evades the cross source jquery limitation that chrome imposes. Not very interesting, but finally i can see vertex colors! First an example on ultra low poly stuff.

This provides a point to progress from. VertexColors_blender.html. I stripped out all the annoying rotation data and implemented the drag stuff from the threex modules: working vertex colors ( tho, one must set "vertexColors": true manually after the export). Working example here. And a screenshot