Journal of Trefall

28 comments
64 entries
Advertisement
Trefall
May 15, 2010
Framebuffer + depth buffer
So, I finally solved a major bug today! I didn't do any depth testing for my scene! :P Turns out, you'll have to provide an FBO with a depth buffer in order for it to do depth testing, for some reason this didn't strike me as obvious, even though it is! :P Thanks Stefan for pointing this out!

As a r…
750 views
Trefall
May 15, 2010
Terrain detail textures
I added detail texturing to the terrain. What I did was add another texcoord set to the terrain (which in 3.1 is just another attrib in the vbo), and mix that with the base terrain texture.

In L3DT I have exported a 4k x 4k texture map, normal map and attribute map, while the heightmap is only 128 x…
1,377 views
Trefall
May 13, 2010
Cleaning up a bit
Last week I did a lot of ad-hoc coding, just to get features in. This week I started to do some cleanup of that code, moving code into more generalized APIs.

I added a uniform interface for the shaders, and did the same thing with textures. When I add a texture to a node now, I also have to tell whi…
722 views
Trefall
May 11, 2010
Bloom post-process filter
After a bit of work, I finally got my bloom post-process filter to work!

The way I do it is to render the bloom in 4 passes, rendering a screen-sized quad with the texture every pass.

First I render the scene to a texture that I slap on a quad, then I render the quad, sending the generated texture to…
1,057 views
Trefall
May 07, 2010
Misc details
Fixed up some small details.

The tree is made up of two vertical planes + some horizontal planes. The lighting became all strange due to the vertical planes and their normals. I added a hack/fix in the vertex shader so that if it's a vertical plane, the normal will face up.

Also added an attrib map f…
643 views
Trefall
May 07, 2010
Shadow mapping
Started an experiment today implementing shadow mapping.

Here's some code excerption (beware that there are probably some hacks in there right now):

Two renderpasses:

glBindFramebuffer(GL_FRAMEBUFFER, fboShadowPass); //Rendering offscreen
{
//glViewport(0, 0, depthShadowMapSize, depthShadowMapSize);
804 views
Trefall
May 06, 2010
Light direction....
Turns out my light direction was way off...

Here's what it looks like now

glUniform3f(glGetUniformLocation(node->getShaderProg(), "DirectionalLight1.direction"), 0.0f, -0.8f, -1.0f);
glUniform4f(glGetUniformLocation(node->getShaderProg(), "DirectionalLight1.ambient"), 1.0f, 1.0f, 1.0f, 1.0f);
g…
636 views
Trefall
May 06, 2010
Water plane and more investigation
As with all programming tasks that break into new domains, investigation and searching for papers/discussions of the topic takes much more time than actual coding.

I rather quickly added a water plane to the mix, where I in the fragment shader make sure that the texture tiles.

I've read some about gr…
577 views
Trefall
May 06, 2010
Phong and normal mapping
So I've worked some more on the integration of shaders. Turned out that the normal map needed to be inversed for normals to point the correct way in the image below, which is why the result was so "ambient" :P

I now seperated the code into one shader I call bump, which only cares about the normals i…
670 views
Trefall
May 06, 2010
Shader implementation
I started the shader implementation today, starting with a bumpmap shader.

It doesn't look any good at all yet, because I have no real normal maps :P I haven't spent any time on a good placement of the light yet either (only use a simple directional light in the shader for now).

I've optimized some c…
631 views
Trefall
May 05, 2010
Almost there...
I'm almost there with the rewrite to OpenGL 3.1 now...

I haven't quite got the picking to work again. I adapted the Mesa gluUnProject into my own camera code, but there's something wrong here... not 100% sure what the modelView matrix should be here... I only have the view matrix from the camera as …
512 views
Trefall
May 05, 2010
Finally "something" is rendering again!
Yeah, I've been doing major rewriting these last couple of days, disabling rendering and all due to how deep changes that had to take place.

I'm now calculating the projection, view, model/globalTransformation and normal matrix myself, and have added a minimal shader that place the vertices using th…
615 views
Trefall
May 03, 2010
Cleanup more or less done, ready to start shading
So last week was cleanup week. At crunch-time I noticed some issues that I listed in the report of delivery, and I went through that list and did some changes.

I didn't get time for all of them, because RL got in the way some.

1) I ended up implementing a lib3ds wrapper. Rewriting the ms3d loader int…
438 views
Trefall
April 28, 2010
TD Engine optimalization
So I've started to work through the list of optimalizations and bug fixes I want in place before I move to the shader implementation.

First thing I did was to attack #2 on my list. I implemented a renderInfo factory that checks the nodetype and makes sure that the same node type only get a reference…
591 views
Trefall
April 27, 2010
Tower Defense part2, rewriting for strict Opengl 3
So the project now continues in a second project. We're to rewrite the game into following a strict OpenGL 3.1 core model (GL3/gl3.h). Finally we're allowed to use shaders! It's been hard staying off the temptation!

I'm thus reading up on the 3.1 spec. I already handle all transformations for my sce…
751 views
Trefall
April 25, 2010
Tower Defense project submitted
So the first tower defense project has now been submitted. Phew did the time just run away today as I was grinding in features to make the game more complete!

Today's list:
- Animated health-bar
- Factory instance handling and recycling with instance pool support
- Death handling
- Per-component death r…
715 views
Trefall
April 25, 2010
Within the last hours of crunch!
So, I worked and hosted a party yesterday. Got zero work done. Today I woke but with a headache. Perfect start of the last day of crunch before the project must be submitted.

I have approximately 9 hours left now, and a long list of features. Hopefully I'll get pretty far on that list, and hopefully…
589 views
Trefall
April 23, 2010
No sleep while in crunch!
So, I've been coding half asleep this night. I felt that I had to get back in the railgun code, so that the towers would visualy fire at critters that enters their perimeter. This code also handles gameplay logic in terms of damage, accuracy and targets. I've changed up the structure a little bit f…
726 views
Trefall
April 23, 2010
Collision back in!
Today I worked back in collisions with quite a few improvements to the collision engine. I also added back in the perimeter object for towers. Won't be long now before I have towers shooting at those critters with an abandon again, but I didn't want to rush it! So, hopefully I'll get another hour o…
542 views
Trefall
April 22, 2010
Towers to the rescue!
Like I said in the first post about this project, a friend of mine was kind enough to build me some modular models for the towers. I finally got around to implement them now. This is only a first test with no upgrades, no rotating heads and now shots fired, but thought I'd share the progress :)

517 views
Trefall
April 22, 2010
Pathwalking works!
So after a long day of patience and bug tracking I tracked down those little critters!

First where some minor bugs in the way I did the pathwalking stuff and the core waypoint system, guess I was tired yesterday! But the main issue though was in the way I handled transformations per node. Up until t…
528 views
Trefall
April 21, 2010
GUI logo and pathing
So I got a friend of mine, Bjorn Hurri, to make a speedpaint for the project that I can place on the main menu and different menues to add some atmosphere and consistency. Thanks a lot Hurricane!

I've been struggeling some with my pathing today. I got the loading off of the texture data to work pret…
542 views
Trefall
April 21, 2010
Back on track!
Ugh! Turned out that implementing the game state system into my current codebase quickly got messy. Tons of strange bugs started to errupt. Also, I found that alot of garbage code and inconsistency had creeped into my project over time. Thus I decided to do a complete rewrite of the project from gr…
603 views
Trefall
April 14, 2010
Game State Management and refactoring
Turned out that my engine wasn't really ready for the game state management implementation. Things quickly started acting strange when I switched, displaying all kinds of odd problems. I realized quickly that this would require some from ground up refactoring of how some core systems work in order …
491 views
Trefall
April 13, 2010
Component-based Entities using Properties updated
As a small escape from Tower Defense I updated my component-system a bit. Partly through usage and partly through community feedback I've been changing the source over time, and finally found time to complete the implementation for a new release.

Savuporo, over at Ogre3D forum, was so kind to provid…
437 views
Trefall
April 12, 2010
Basic Tower Defense done.
So, I finished up the very basics of a tower defense game today. I added in win/lose conditions today. Now, the player still spawns the mobs manually, so I guess it's not completely a basic tower defense game... but I wanted to move on to the screen handling before I went there, there's certainly e…
504 views
Trefall
April 10, 2010
Another day of Tower Defense
So yet another day of work on this school project, and it's starting to shape into an actual game finally!

I refocused my efforts a bit on trying to get the most basic parts of tower defense together first, so I put on hold the GUI work for tower upgrades and focused on more important tasks.

Today I …
536 views
Trefall
April 09, 2010
Tower Defense project continues
So, today I did some cleanup after all the refactoring. Tons of code that was either commented out or partly commented out went into the garbage can. I also made the boundary circle only render in debug mode (though the perimeter circle for towers still remain for the time being).

I fixed my death c…
522 views
Trefall
April 08, 2010
Tower Defense school project
In a class at school we're doing a Tower Defense game now, and I've been trying to stay focused this time instead of getting carried away with all the fun stuff.

The class i seperated into two projects, each counting 50% of the final grading. In the first project, which is running now, we will focus…
2,645 views
Trefall
October 26, 2009
Component-based Entities using Properties
Component-based Entities using Properties

Introduction
This is my second public design for using compoents with entities to prevent deep hierarchy problems and make the game object difinition more data-driven. By data-driven, I mean that you can define your game objects in for example XML.

Third party…
802 views
Advertisement

Popular Blogs

shawnhar
Generalist
101 Entries
9 Followers
15 Entries
10 Followers
johnhattan
Programmer
1,277 Entries
47 Followers
ApochPiQ
Generalist
628 Entries
44 Followers
dgreen02
Generalist
338 Entries
56 Followers
Advertisement