Spellcaster Studios

Make it happen…

Yearly Archives: 2014

OpenGL Porting – Part 7

Almost, but not quite there… Basically, only one thing remaining: finding out what are the vertex/pixel constants required for the shader in question… I should be able to iterate them with glGetProgramiv(program_id,GL_ACTIVE_UNIFORMS…), but this always returns 1, which can’t be… After I solve this one, I’m golden! Then it’s debug time to know why the […]

OpenGL porting – Part 6

I swear I’m almost done with the development environment screenshots! Today I did a lot of progress on the OpenGL porting, hopefully tomorrow I’ll be able to finally display something on the screen beyond the yellow screen I have currently! There’s a lot of stuff that OpenGL works differently from DirectX (most of it is […]

OpenGL porting – Part 5

Christmas season, so not much time to work on the game (not even browsing the net, if you’ve noticed the lack of link of the day)! So…. New texture class (to abstract the OpenGL texture, which is a bit more important than in the case of DirectX). The code became prettier… That is all… Now […]

OpenGL porting – Part 4

Today I really got into the OpenGL porting… It will take a while, but it’s going nicely… Nothing to show for it (3d graphics usually require a lot of different stuff in place before they can actually produce results), although it will be a case of “nothing to show” to “everything to show”… 3d rendering […]

OpenGL porting – Part 3

Today was a wasted day… :\ Decided to see if my changes screwed up the D3D renderer, and boy did they! This is what I had waiting for me, instead of the main menu: Booted up Pix, and found out that I had a the declaration of the alpha test reversed, so no big deal… […]

OpenGL porting – Part 2

Finally finished the “compile” part of the work… The system now compiles in a OpenGL executable, and the amazing results is: Which is to be expected, since I didn’t actually place any OpenGL code in it anymore, just breakpoints for when the code reaches that position… So, coding time! Now listening to “The Sinister Urge” […]

OpenGL porting – Part 1

Well, nothing blog-worthy today, really… It was mostly just clearing the D3D code (or more precisely, putting it behind the #defines that shut it down), and replacing structures and enums (like primitive type) by more cross-platform ones… So, very boring, and very necessary… I’ll probably spend the next few days working on this OpenGL porting, […]

GLSL Optimizer

Today I integrated GLSL Optimizer to my shader code… It had some quirks: Doesn’t accept #line directives with name of the files, so I have to strip that when feeding it Doesn’t accept OpenGL 3.30 shaders   This last one isn’t that bad, although I was using 3.30 shaders (the tutorials I was using were […]

Preprocessor

Today I worked on building a preprocessor for GLSL… Well, I didn’t exactly built a preprocessor, GLSL has one (contrary to what I understood previously), but it doesn’t work like the Direct3D one. On the D3D one, when I ask him to compile a shader, I give him a series of preprocessor macros and he […]

HLSL2GLSL

My plan from the start was to use a converter to get my HLSL shaders to GLSL on the OpenGL version of Gateway… I was going to achieve this by using hlsl2glsl, but after fumbling around it for a bit, I don’t think I can use it without breaking much more stuff than it’s worth: […]