Friday, July 23, 2010

SIGGRAPH 2010

I am flying off to LA to attend my first ever SIGGRAPH conference tomorrow. I couldn't be more excited - its something i've always wanted to do since discovering SIGGRAPH papers existed when I was studying computer graphics at UMIST. ( 15+ yrs ago ! ).
I'm not sure why exactly but i've always been a fan of Jim Blinn's articles and work, and always thought it would be quite cool to attend a talk of his or meet him at Siggraph perhaps.
Any road up I am also due to give a short presentation at Pixar's exhibition booth about rendering the Olympus Map room clouds for Clash of the Titans. I am experiencing terror and excitement in equal measure. This is a new experience, usually its just the terror on its own. Fingers crossed it all goes to plan.

Tuesday, July 13, 2010

Diagram of the Day 2

Todays winner comes from the cutting edge of towel research.

( again, page 3 seems a popular choice ) :

http://reference.kfupm.edu.sa/content/a/b/abstract_a_layered_method_for_realistic__76571.pdf

Diagram of the Day 1

How they ever managed to sneak a picture of a cock and pair of balls past the moderator, i'll never know...

http://www.cemyuksel.com/research/dualscattering/dualscattering.pdf

( from page 3 ):

Wednesday, July 07, 2010

Makefile and GLSL

So it turns out, as cool as GLSL is, there's no support for #include directives.
Arse.
Includes are quite handy so they are.

Right, so what we need now is some existing pre-processor to expand the includes in-place.
What about gcc -E ( or g++ -E ) ? Weeelll, they are ok, but they leave place markers everywhere, it doesn't read very nicely. Also you'd have to name all your glsl shader files .c or .cpp or something icky like that.

Turns out you can run "cpp -P" and that will pre-process the includes nicely. It works on any old file name too - so no problem calling them .glsl
How do I automate it though ? A script ? A makefile ?
Well, since you're preprocessing code, its near enough to a compile to use a makefile.
This is where the (un)fun begins... actually lets cut a long story short, i'm already sick of makefiles without recounting blow by blow details.

basically you'd do this:



GLSL_SHADERS := $(wildcard hwshaders/*.glsl)
GLSL_SHADERSOUT:= $(GLSL_SHADERS:.glsl=.glslo)

%.glslo : %.glsl
@echo $< $@
@rm -rf $@ ; cpp -P $< $@

glsl : $(GLSL_SHADERSOUT)


and then run

make glsl

Which would expect the glsl files to be one directory below the makefile in a dir called hwshaders.
Also I found out that if you are using a makefile conditional if, then the @ thingy to silence command echo doesn't really work. What did work for me was using the .SILENT rule.


.SILENT: safepub

safepub:
make clean
make
echo
if test -e /some/path/or/other/my.file; \
then \
echo File Exists \
else \
echo Doesn't Exist \
fi


so let that be a lesson to ye.