Colour scheme.
Edited:
Goddammit now I've got to go get some content.
Edited:
![]()
Colour scheme.
Edited:
Goddammit now I've got to go get some content.
Edited:
![]()
Had a lot of fun writing this unfinished "procedurally generated" shoot-em-up in JavaScript + Canvas. Not guaranteed to work in all browsers, but all of the latest major ones should do. Z to shoot, X to use the Nuke if you have one and use the arrow keys to move about. Zoom in the page (Ctrl+Scroll) if the screen is too small at your resolution.
The enemies are placed randomly in a series of pre-programmed wave types, which in turn appear randomly as well. Most graphics were done by friends of mine, save for the HUD and some (arguably ripped) minor graphics. Sounds are courtesy of BFXR
(http://www.bfxr.net/).
http://www.dvdflick.net/zspace/
http://www.dvdflick.net/zspace/zspace_dev.zip for the messy source code and a sound-enabled version, complete with terrible sound effects. Some large uncompressed images and sounds have been removed, but nothing vital.
Therefore you must rate him artistic!
oh wow I didn't know bfxr existed, it's definitely better than the already amazing sfxr.
Whoa. sfxr version 2.0? I never knew about this.
Edit: Must refresh before posting. D:
seeing all this content makes me sad that I cant do it haha
oh well. I got enough on my plate with my senior capstone project.
I/O monitoring and enforcement inside a hypervisor...
Vertical emancipation grills and loading.
Yay.
Also somehow my tiles got a different color. I'll fix that.
The goombas die when they walk into the grill! Fun.
My life be like 000AAAh
Catmull-Rom Splines for the curve. A particle emitter with procedural generated particles.
And a sort of "texture generator" (the blue thing).
I'm just programming stuff that I might need for projects / games in the future until I get a good idea for a game![]()
Highly relevant.
@Maurice: How do you detect and resolve collisions in your game?
I tried AABBs, Pixel-Perfect and Sensors at the 4 corners of a AABB but none of the solutions work perfect in every situation.
I'd also like to hear what Maurice does, but if my experience matters for anything, everything generally boils down to line-line checks when I'm doing collisions. Abstracted, it's generally line-"some other shape".
Granted, I've never done a platformer so maybe there's some issues I'm not aware of.
Weapons are now generated procedurally by attaching a magazine, a stock and a grip to a core piece. They all change how the weapon behaves. Here's some generated weapons.
![]()
I'm very, very, very slowly working on turning my token list into an abstract syntax tree.
So far I've managed to turn this:
i32 hello = 10; i32 test(i32 something) { hello = 10; } i32 doStuff(i32 what, i32 that) { hello = what + that * 5; return 20; }
Into this:
![]()
Did you also program the tree graph or is it some utility because I could use it as well
If you can elaborate on that (i.e., what type of collision, world vs entity or entity vs entity, and when it fails most commonly), then we can definitely help you.
Remember my platform engine? I sort of improved it but it's really complex now. Collisions work almost perfectly though. I can explain to you on steam in a few hours.
(Also added sweep collision tests, and made weapons accept ANY number of attachments.)
I didn't, I used this: http://www.ironcreek.net/phpsyntaxtree/
It has a really simple syntax, so it's easy to have your program output a plaintext string that you can then throw at that website.
Working on something like this myself.
Should that be called Not Competition, then
Are you using an algorithmic technique (as in shift-reduce parsing of an LR(1) grammar or somesuch), or are you "making it up as you go along"?
Making it up as I go along. Sort of.
I am the master of strange bugs.
Code:in vec3 inColour; out vec3 fragColour; void main() { stdTransform(); //fragColour = inColour; fragColour = vec3( 0.0, 0.8, 0.0 ); }
Working perfect. Now, let's just uncomment that line and use colours from my array.
Code:in vec3 inColour; out vec3 fragColour; void main() { stdTransform(); fragColour = inColour; //fragColour = vec3( 0.0, 0.8, 0.0 ); }
Err
Pretty sure you'll want to make that color a vec4
Looking good, cant wait to try it out.
In the frag shader:
Code:in vec3 fragColour; out vec4 outColour; void main() { outColour = vec4( fragColour, 1.0 ); }
what is stdTransform(); ?
My third vertex shader:
I just found the bug though. Apparently you can't miss out any attributes in the shader declarations, and they have to be in the same order that they are mapped to the indices.Code:in vec3 inPosition; uniform mat4x4 mtxProjectionModelview; uniform mat4x4 mtxModelview; void stdTransform() { gl_Position = mtxProjectionModelview * vec4( inPosition, 1.0 ); }
Having that at the top of my shader fixes the bug, whereas:Code:in vec3 inPosition; in vec3 inColour;
Doesn't work. inPosition and inColour are mapped to attrib index 0 and 1 respectively.Code:in vec3 inColour; in vec3 inPosition;
Edited:
So yea, I've been working on a basic OO wrapper which sits over OpenTK. A spinny coloured quad is rendered like so:
using System; using System.Diagnostics; using OpenTK; using OpenTK.Graphics; using OpenTK.Graphics.OpenGL; using GLEx.Buffers; using GLEx.Misc; using GLEx.Shaders; namespace TestProject { public class TestWindow : GameWindow { private Camera viewpoint; private Mesh triangle; private ShaderProgram shader; private Stopwatch timer; private static GraphicsMode Mode { get { return new GraphicsMode(new ColorFormat(32), 24, 8, 8); } } private static readonly string shdrVertex = @" in vec3 inPosition; in vec3 inColour; out vec4 frontColour; void main() { stdTransform(); frontColour = vec4( inColour, 1.0 ); } "; private static readonly string shdrFragment = @" in vec4 frontColour; out vec4 outColour; void main() { outColour = frontColour; } "; public TestWindow() : base(1024, 600, Mode, "GLEx Test Project") { } protected override void OnLoad(EventArgs e) { GL.Enable(EnableCap.DepthTest); GL.Disable(EnableCap.CullFace); GL.ClearColor(Color4.SkyBlue); this.VSync = VSyncMode.On; viewpoint = new Camera(); viewpoint.UpdateProjection(this.Width, this.Height, (float)(Math.PI / 3d)); viewpoint.Position = new Vector3(0f, 0f, -2f); viewpoint.Angle = new Vector3(0f, 0f, 0f); triangle = new Mesh(); triangle.Generate(2); shader = ShaderFactory.QuickCreate(shdrVertex, shdrFragment, false); ShaderFactory.AttachStandardVertexShader(shader); shader.Compile(); triangle.Usage = BufferUsageHint.StaticDraw; triangle.Shader = shader; triangle.BufferData(new Vector3[] { new Vector3(-1f, -1f, 0f), new Vector3(-1f, 1f, 0f), new Vector3(1f, 1f, 0f), new Vector3(1f, -1f, 0f) }, "inPosition"); triangle.BufferData(new Vector3[] { new Vector3(1f, 0f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 0f, 1f), new Vector3(1f, 1f, 1f) }, "inColour"); triangle.BufferIndices(new uint[] { 0, 1, 2, 0, 2, 3 }); timer = new Stopwatch(); timer.Start(); } protected override void OnRenderFrame(FrameEventArgs e) { GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); viewpoint.ClearMatrixStack(); viewpoint.ResetPerspective(); float ang = 0.25f * (float)(timer.Elapsed.TotalSeconds * Math.PI); viewpoint.PushMatrix(); viewpoint.Translate(Matrix4.CreateRotationY(ang)); triangle.BeginRender(); viewpoint.PrepareShader(shader, ProjectionType.Perspective); shader.BindFragData("outColour", 0); triangle.FinishRender(); viewpoint.PopMatrix(); this.SwapBuffers(); } } }
Assuming indices is never a good idea. Either fetch them using glGetAttribLocation or specify the attribute location manually. Also, what the hell is stdTransform?
Also, if you're writing GLSL 330 or newer, you can specify attribute locations with "layout(location=0) in vec3 color" right in GLSL code, which I thought was pretty spiffy.
Though I'd prefer a solution with glGetAttribLocation as it makes the code a bit easier to read in my opinion.
Graphviz is another good tool for visualizing structures. It also has a very simple plaintext format.
I don't want to assume the indices, but apparently the order in which the attributes are defined in the shader must match the indices defined in code. Which completely defeats the objective of linking shaders. Unless I'm doing something wrong. Does this mean the proper way to do it involves programatically generating parts of the shader?
You need to manually specify the location of the attribute by using glBindAttribLocation or using the layout() syntax I mention above, or you have to retrieve the location with glGetAttribLocation.
I have a half-done converter for string encodings, since Windows uses UTF-16 and I'm using UTF-8. Ah, at least all the symbols get put to good use.
😼
I am using glBindAttribLocation already. Using the layout syntax means programatically generating the shaders, which I'd rather avoid. I know the locations of the attributes in software, and I'm mapping the attrib indices to the respective name. OpenGL just doesn't seem to want to link it properly.
When are you calling glBindAttribLocation? It should be called before you link the program. If you call it after linking, the binds won't go into effect until you re-link it.
That fixed it, thanks. I got confused about what an attrib index really was.