Just playing around with some pixel shaders. I made a random noise function:
The idea was to try and use this to figure out how to do SSOA but I gave up because it’s not important yet.
To plan for the scene I’ll need to come up with a list of objects that will be needed and then put them into a class diagram.
That’s basically it. Now let’s figure out how these relate to each other:
So basically the whole scene will be held in “Scene” and then the scene will be made up of a bunch of scene nodes parented to the root scene node. The UML shows how they all derive from each other
I think from here I can start coding. Which I’ll talk about in the next post.
This week we learnt how much of a bitch transparency is because of how OpenGL decides which order to draw something.
You will see in games, even these days, sprites that have transparency in them, like leaves or water, get drawn in the wrong order.
PARTICLES
I like particles.
We learnt how particle systems work and that the best way is to have single verts flying around and make the geometry shader convert them to billboards.
Usually particles are in the form of “billboards” which basically comes down to “thing will face camera”. There are particles that face the camera from both vertically and horizontally, and also billboards that face only on one axes. Like a barrell or a tree.
The other thing that was covered this week was “GPU PROFILING” which is basically looking at what the GPU is doing udsing nVidia programs and what not. nVidia tools look pretty neat.
This week I basically worked on my node class getting my planets to be attatched to the sun node and also rotate at their own local axis.
Silly Jupiter. WAT U DO. Y R U ON UR SIED?
This is what happens when you try and mess with the matrix’s 4th row and not change the rotation bits:
Yeah…
I also did a bit on vertex shaders. I had already done this but accidentally over-wrote it with another exercise and working on my lava because I’m a dumbass.
Playing around with the Y of the verts accidentally came up with this:
It looks so smooth! Almost like looking at something under an electron microscope.
I eventually came up with this thing, which is what the exercise asks:
It looks more impressive when it’s animated.
Anyway… time for another week.
For my assignment, I’m doing a cloudy scene.
It turns out today is a cloudy day.
I took photos for reference.
The tree and the cars are good examples.
Basically the shadows are like “projector shadows” (just under the thing) and get darker the closer they are to contact (see in the car example).
This is probably similar to “skylight” effects. Basically what the blue colour of the sky does to shadows of things. Then there’s the light from the sun that casts the main solid shadow.
The thing is, though, you don’t really see the skylight make these sorts of shadows. I think it’s because the sun light almost over-writes this because it’s so bright. But maybe more realistic lighting might take this into consideration. Secondary lighting also (like sunlight bouncing off objects) probably add to this.
Silly sun. You so bright.
So yeah, this means that despite me wanting to actually do shadow maps, I might not be able to because they’d look out of place. Maybe I could get extra marks for a sexy inclusion shadow shader or something. HMMMMMM?
This week in class we learnt about animation. Something I’m keen on.
But in 3D it seems a lot more mathsy.
That’s a word now.
It’s basically all to do with:
Because this week I wanted to catch up on my shadow work, that’s what I did instead. Animation can be done later. Although this week we missed Wednesday because of the public holiday, and on Thursday I got sick, and took Friday off. I spent the weekend being sick and did some assignment work.
All and all a very non-productive week.
Hello blog. Hi Jimmy, said the blog. Wait…
Because I really hate reading boring articles and get distracted easily, I’m going to try and make all my posts as interesting as possible, and coenside this with the comments in my code.
I know a guy called Coen actually.
The first thing that needs to happen is getting a Visual Studio solution set up to run this game. This is probably the most fun part because it;s easy and you can’t cause bugs that take hours to complete.
Wrong. I have to do planning first.
Basically make a demo scene with a camera that I can control to show it the F off.
It has to have:
I’m planning on making a volcano scene. I was and still am inspired by the volcano level (Eridium Blight) in Borderlands 2. Here’s some pictures:
I sat there in Borderlands 2 for probably 30 minutes looking at the detail that went into this lava and I noticed the following:
This is a lot better than the deadful lava in Starcraft II:
OH GOD IT BURNS MY EYES. Not in a lava burn way, but a “I can’t stand to even look at it” way. It’s low resolution, doesn’t animate, and looks flat. It doesn’t even appear like it’s bright. It looks more like a Persian rug is coming up to destroy all my units and buildings.
My scene won’t actually have an erupting volcano, but I do want some particles coming out of it like black smoke, soot and bubbles of lava. Also snow-like soot like on Borderlands.
I now have the lava down pat. The next thing is the scene generation.
I plan on having a hight map generation using perlin noise, over the top of another map that contains the volcano’s “norm” shape. Something similar to the following:
Combined would look something like this:
Then, I’d add a plane of lava just around the lowest Y area and make sure the 2 hight maps together don’t go too low. You will notice that the centre of the volcano ring overlay is darker than the outside. This is the key to having the lava only in the volcano. It might even have a few rocks pointing out of the lava, which would be okay.
Beautiful.
I don’t plan on generating the volcano ring (at this state, although it’d be possible because I just made it with an oval gradiant in Fireworks) but If I just use the image I could play around with the shape of the volcano, maybe give it some natural looking veins or something.
The light source will be a skylight coming from the sky, and an orange one coming from the volcano. This will ensure the inside of the volcano’s walls are lit up by the lava. There will also be a general diffuse colour around the rocks.
Because I want to do shadow maps, I’ll be adding in blurred shadows. This is because The scene is going to be cloudy.
I’ve combed TurboSquid.com for trees. I thought that I could randomly place a set number of dead trees around the map (avoiding the volcano) using circle maths for distance. These should be textured, lit and cast shadows. Naturally.
For my advanced bit, I’m adding in advanced shadows because shadows are kick-ass like unicorns. So the light source is going to be a sun. Again, the scene is dark and cloudy, so I want to try and blur the shadows a bit to appear like ones in a cloudy-ish sky.
The camera will just be a normal one much like the AIE Framework camera. WASD will move it, and the mouse will aim it. Nothing too fancy.
The scene will be set up using a scene graph. This will be represented by simply having all the trees as children to the landscape. It won’t be dramatically noticable but it will be made like that.
I’ll add a transparent, cloudy plane as the sky. If I have time (and can figure it out), I’ll add a skybox.
There will be a sort of fog in the game. This will make the landscape nicer and hopefully cut off the edges of the map so you can’t see the box where the hills are. The only issue with the fog would be the lighter parts of the map should shine through more than the darker ones. This will be a challenge. For example, looking at the sun through fog.