Xonotic Forums

Full Version: Darkplaces Code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Has anyone messed with the engine code? It's a nasty mess with very little in the way of comments. I'm looking for the offset mapping shader, but I've been going in circles. I am determined to shred this code to pieces till I understand it. I want to optimize a good chunk of it if possible, it feels slow sometimes.
grep "offsetmapping" *.c


--> gl_rmain.c

static const char *builtinshaderstring
Ahhh, duh, though win7 doesn't have grep Sad That's what I was worried about, I didn't see any references to shader code. Means LH didn't write his own...

Edit:
Nvm, it's a large string, parsed by GL? Who cares...I'll start sorting through it.
Hmmm... doesn't Win7 have some sort of indexing service for a fulltext search on files?

Anyway, yes, GLSL shaders are delivered as sourcecode to the driver, which then compiles them, optimizing for the hardware present.

Same is true for Cg. I think this also applies to HLSL, less sure on that, though.