Penumbra: Overture (feasible?)


sswam

Advanced Member
Joined
Dec 16, 2009
Messages
1,393
I'm impressed with how well Aquaria runs on the Pandora, using lunixbochs' libGL.

Penumbra: Overture was also open-sourced after the 1st humble indie bundle, and I'd like to try porting it with this excellent libGL.

I'm creating this thread to chronicle my descent into madness!

Anyone likes to help with dev / testing?  Great!  post here, PM or come on the IRC #openpandora @ irc.freenode.net, I am "sswam" there.

Sam
 
Last edited by a moderator:
Doesn't this game use shaders a lot?


I think they are not supported by lunixbochs gl right now.


But good luck :)
 
Doesn't this game use shaders a lot?
Yeah it does... we'll see how it looks / performs without them, for a start!

progress so far:

- built a working penumbra overture from source on/for my x86_64 laptop  (audio stutters a little...?)

- built newton-dynamics on Pandora  (with minor fixes)

- started building angelscript on Pandora, fails at link time (!) with:

    - as_callfunc.cpp:(.text+0xf18): undefined reference to `CallSystemFunctionNative(asCContext*, asCScriptFunction*, void*, unsigned long*, void*, unsigned long long&)'

    - not sure what's going on there yet, maybe some wrong about type sizes

- started building penumbra on Pandora, fails with this error, due to newer fussy g++ / borken angelscript:

    - HPL1Engine/sources/impl/stdstring.cpp:162:94: error: overloaded function with no contextual type information

    - they are trying to cast overloaded operators like operator== to function pointers with particular types, ugh.

    - it works with gcc-4.3 from old cdevtools!  gets a bit further

    - then it would like to have  Cg/cg.h, if you please!  hmmm.... guess I will make a fake one.  Not tonight. 
 
Last edited by a moderator:
I'm going to start with stubbing the functions, i.e. the shading will be absent or wrong.

Can perhaps translate the Cg code to GLES GLSL in advance using nvidia cgc and some hackery.

I just want to build the damn thing for a start, even if it's fully wrong,

don't mind if the graphics are upside down unshaded monochrome or whatever.
 
Last edited by a moderator:
I'm sure in the porting process Cg shader support could be replaced with GLSL support. Especially if porting to Open GL ES 2.

eg Simple passthrough Vertex shaders:

Cg

// input vertex
struct VertIn
{
float4 pos : POSITION;
float4 color : COLOR0;
};

// output vertex
struct VertOut
{
float4 pos : POSITION;
float4 color : COLOR0;
};

// vertex shader main entry
VertOut main(VertIn IN, uniform float4x4 modelViewProj)
{
VertOut OUT;
OUT.pos = mul(modelViewProj, IN.pos); // calculate output coords
OUT.color = IN.color; // copy input color to output
return OUT;
}

GLSL

#version 140

uniform Transformation
{
mat4 projection_matrix;
mat4 modelview_matrix;
};

in vec3 vertex;
in vec4 color;

void main()
{
gl_Position = projection_matrix * modelview_matrix * vec4(vertex, 1.0);
gl_Color = color;
}
As you can see, the two are quite similar, so porting from Cg to GLSL should be fairly straight forward...depending on the complexity of the shaders.
 
but in any case if you have to use GLSL then you have to use opengles 2.0, which the lib wrapper wont have any help with (since Im sure its using fixed es api 1.X)
 
Back
Top