Polyhedra Development Thread


Yee Haw, ive gone 2.0.
GL ES 2.0 that is :)

I added in a shader class and interfaced it into my model class. Right now the shaders only do geometry and diffuse lighting, but this a big step for me personally.
I also have designed the preprocessing so that ES targets should pick either the fixed or programmable paths and the full desktop builds can have both compiled in.

Also remembering my retro games, i feel that the game galaga is a closer match to what im trying to model after: http://en.wikipedia.org/wiki/Galaga
 
PokeParadox said:
Wow! You have made this step quicker than I would have thought... I haven't really gritted my teeth on ES2.0 yet... grats!

actually its not as hard as I thought it was going to be, granted i still have things to learn and get working.
A lot i picked off the http://pandorawiki.org/GLESGAE, opengl superbible, and other examples on the web :)

The vertex data interfaces for GL2 matches up pretty well with the vertex arrays for GL1. Loading, Compiling, Linking shaders into a program isnt too bad. Then you need to bind the attribs and uniforms back to the vertex loader. Im working on the lighting parts of my code right now.
I wish it handled non-texture and texture fragments better, the standard approach it to have 2 shaders that are basically the same thing, which seems wasteful.

My 2d projection isnt working.
 
Last edited by a moderator:
Pickle said:
The vertex data interfaces for GL2 matches up pretty well with the vertex arrays for GL1. Loading, Compiling, Linking shaders into a program isnt too bad. Then you need to bind the attribs and uniforms back to the vertex loader. Im working on the lighting parts of my code right now.
I wish it handled non-texture and texture fragments better, the standard approach it to have 2 shaders that are basically the same thing, which seems wasteful.

My 2d projection isnt working.
Yes you have to handle all projection matrices yourself in ES2 and GL2 And yes we touched on the basics of GL2 coding in uni... but I never got into any intensive implmentation and still haven't got completely into it. Someone invent me more hours in a day please? :D
 
Last edited by a moderator:
PokeParadox said:
Pickle said:
The vertex data interfaces for GL2 matches up pretty well with the vertex arrays for GL1. Loading, Compiling, Linking shaders into a program isnt too bad. Then you need to bind the attribs and uniforms back to the vertex loader. Im working on the lighting parts of my code right now.
I wish it handled non-texture and texture fragments better, the standard approach it to have 2 shaders that are basically the same thing, which seems wasteful.

My 2d projection isnt working.
Yes you have to handle all projection matrices yourself in ES2 and GL2 And yes we touched on the basics of GL2 coding in uni... but I never got into any intensive implmentation and still haven't got completely into it. Someone invent me more hours in a day please? :D

Im using this for all my matrix stuff and it makes things a lot easier : http://cmldev.net/

For projection i use the matrix_orthographic_RH (2D) and matrix_perspective_xfov_RH (3D). For fixed i just set the GL_PROJECTION to the mode i need to be in. For programmable i just multiply the projection onto each of of the model view for each model.

For modelview I do scale, rotate, translate cml functions. If in 3D mode(camera) I use the matrix_look_at_RH. I multiply the two together for the final modelview. For fixed is set the the final modelview to GL_MODELVIEW.
If programmable i multiply it with the projection.

For programmable I just send (glUniformMatrix4fv) the final matrix as a uniform where it is used to transform the vertices.
 
Last edited by a moderator:
Ive been making progress on the GL2 render, it supports everything the GL1 render does, but there are some differences in lighting or lack of. I will fix that as i fine tune the shaders.

I put up a pic of the shader on the desktop in action. Have not tried it yet on pandora other than building for, still need to update my EGL code for ES2.

Someone how i broke my text rendering along the way it doesnt render right unless the camera is straight, i must be messing up the matrix's cause it happens in both GL1 and GL2.


Edit:
took a little detour and tied in the existing sound code i had into the game logic. I added a list of sounds and music, which can be assigned to player and monsters for attacks. Music is indexed per wave. Works well :)

Edit 2:
Must be a good night, found the issue with the 2d text, the camera lookat matrix was getting multiplied into the text modelview when it shouldnt have been.
 
Pickle! This is all very nice, but when are you going to fix your Quake (and Quake3) ports? Maybe add support for the Pandora controls a bit better? Any chance of that happening?

D.
 
Dunny said:
Pickle! This is all very nice, but when are you going to fix your Quake (and Quake3) ports? Maybe add support for the Pandora controls a bit better? Any chance of that happening?

D.

Theres a chance but i cant tell you when, im aware that q3 seems to be bad for most people. It basically comes down to this, I dont have a ton of time i can program so I have to pick and choose what i work on. So typically that comes down to what interests me at that moment. Which at this time is learning more about opengl.
I know it would be a good thing to work on q3 so its more usable, so in other words I will get to it when something isnt more appealing or i can force myself to mess with it.
 
Last edited by a moderator:
Added config and logic for powerups when enemies are dispatched.
Also added some audio config options like volume.

I think I want to add some more motion with the enemies themselves. I have to think about how I should do this. I think i want to script (time based) when some enemies appear, then some can follow paths, others may stay statically on the screen like now.
 
sebt3 said:
Would an updated screeny make sense ?

Not really cause the powerups are just using pyramids for the model, so it all looks redundant. in a static screen. I think a video or alpha release might be soon, at least thats what im aiming for.
 
Last edited by a moderator:
kayuz said:
great! i hope in a alpha for caanoo too :)

It will be ES compat, i actually built a wiz version, but just havnt had time to debug what is wrong. If there is no SDL for caanoo with opengl support I may have to take more time to code up a raw egl with raw controls for caanoo.
 
Last edited by a moderator:
Pickle said:
It will be ES compat, i actually built a wiz version, but just havnt had time to debug what is wrong. If there is no SDL for caanoo with opengl support I may have to take more time to code up a raw egl with raw controls for caanoo.
You can found a eglport.[c|h] working on caanoo in caanmines sources ;)
 
Last edited by a moderator:
sebt3 said:
Pickle said:
It will be ES compat, i actually built a wiz version, but just havnt had time to debug what is wrong. If there is no SDL for caanoo with opengl support I may have to take more time to code up a raw egl with raw controls for caanoo.
You can found a eglport.[c|h] working on caanoo in caanmines sources ;)

That part wouldnt be bad as i already have the sdl eglport, its isolating all the SDL calls into generic ones.
 
Last edited by a moderator:
:( ... i hope, anyway, to try your game on the only open console i have ;)
 
Added material support (which breaks my curreent shader renderer). This lets me assign any material or texture per group in the obj format. So for example I could now specify different lighting and texture parameters for each side of a cube. The bad thing is that for the shader path I have to now switch between shaders per this groups. Before I had assumed the model was either all color or all texture. For now though im going forward and when things have progressed I will go back and fix the shaders.

Ive also started the object path functions. Right now I have 2 options a straight linear movement from one point to another. The second is a curve defined by degress, radius, and divisions.
I think the way im going to do with linear is to subtract the 2 points to get a direction vector. I will calculate the magnitude the vector and divide the speed constant by the magnitude. Then i can use the resulting ratio on each component of the vector for my final speed to apply to the current position. If anyone has a better way let me know.

For the curved i use the radius to define the size of the circle, the degrees defines the length of the curve. The divisions is how many linear paths to break the curve down into. So by breaking the curve down into a bunch of linear movements I can use the linear travel I described above. Right now the curve is assumed to be on the x-z plane.

Update: Linear motion is working ;-)

Update 2: I worked some more on paths and ive just about got it. Changed the way i go about it a bit. The config file values are read as offsets from the current position. The curves are split down into lines, but its done at loading rather than at runtime. So the final path is just a bunch of way points. In my last test I did get a 90 deg curve, but in the wrong direction and it looked a bit big. So i think i little more debug and testing on the curves and it will be good.
 
Made some good changes and updates over the weekend.

Materials (obj/mtl) works, this means i can have a infinite number of lighting materials defined by file and then i can specify them in the obj models. For example the test i did was to specify a material for each side of a cube.

Paths work now, they work by defining a starting point, linear travel offsets from the last point, and curves defined by plane, radius, angle, segments (which break down into linear travels)

The Font.obj is done! I have a alphanumeric characters rendering. I may need to add a few others here and there. But its nice to see the score changing now :)

I added an option to the wave config files to specify count, time offset, final position offset for a single monster entry. This mean i can have one line to make a group of monsters that come out on the same path. Once they reach the end of the path they will line up according to the offset defined. Before I was specifying each one per line.

With the last test I did some tests with 60 monsters and it started to bring the performance down on my x1400 radeon linux driver to ~30 fps. Pandora is hitting 20 fps. I may need to keep groups small and trigger new groups based on if earlier waves have been eliminated.
There are also are probably bottlenecks which I just have done with this being my first real opengl engine.

Also since I ran it on the pandora the gles1 code is "error" free. GLES2 is still broke when materials were added.
The GLES1 on pandora has some oddities yet. The intro screen sometimes blacks out on the right hand side. Not sure if this a depth or lighting problem.

All in all a good step and and much closer to having a test alpha ready.
 
Good to hear this, Pickle ;)
if you need tester, for a caanoo version, i'm here :)
 
Back
Top