
GRP2 discussion
Re: GRP2 discussion
I agree to some extend. Writing a program that contains a bug should not result in correct program behavior. On the other hand, once your game has been released, this would actually be beneficial. 

Re: GRP2 discussion
Not a lot of rasterizer-related posts here anymore, would love to see some images of what everyone is doing!
I'm currently remaking Minecraft, which is of course not a classic 2D game but it just seemed like a lot of fun

The landscape is completely generated. I use several 'octaves' of Simplex Noise to generate the heights of the terrain at a certain position and then use the height of a block to determine its type. The block data is then used to build an efficient mesh that has no interior faces, which you would have a lot of if you draw a complete cube per block.
Unfortunately we did not learn how to do proper shadows so I had to fake them. For each triangle of the mesh I check the neighboring blocks and depending on those I change its texture to a darker texture. This means my light is a directional one that is limited to 45 or 90 degree angles on each axis (otherwise the triangles can't form the shapes). However it still looks quite nice:

I hope to see some more graphics posts here. Oh, and happy holidays!
I'm currently remaking Minecraft, which is of course not a classic 2D game but it just seemed like a lot of fun


The landscape is completely generated. I use several 'octaves' of Simplex Noise to generate the heights of the terrain at a certain position and then use the height of a block to determine its type. The block data is then used to build an efficient mesh that has no interior faces, which you would have a lot of if you draw a complete cube per block.
Unfortunately we did not learn how to do proper shadows so I had to fake them. For each triangle of the mesh I check the neighboring blocks and depending on those I change its texture to a darker texture. This means my light is a directional one that is limited to 45 or 90 degree angles on each axis (otherwise the triangles can't form the shapes). However it still looks quite nice:

I hope to see some more graphics posts here. Oh, and happy holidays!

Tom Veltmeijer
Re: GRP2 discussion
Shadows are usually done in OpenGL by using framebuffers. Drawing the depth of the scene per pixel from the viewpoint of the light, then checking the depth at the point of the framebuffer the current pixel would be at (if any) to see if it is visible.
Applying this to a software rasterizer is possible. Just do the same thing: Render from a different viewpoint onto a texture instead of the screen, and sample from there.
Class material from GRP4 on Shadow Mapping: Projected Shadow Mapping with Cg and OpenGL | 3D Game Engine Programming
Applying this to a software rasterizer is possible. Just do the same thing: Render from a different viewpoint onto a texture instead of the screen, and sample from there.
Class material from GRP4 on Shadow Mapping: Projected Shadow Mapping with Cg and OpenGL | 3D Game Engine Programming
Rick van Miltenburg
3GA-1PR
3GA-1PR
Re: GRP2 discussion
Sweet Tom! If you have an update, post some more images!
By the way, a while ago I dabbled with Minecraft worlds as well, and I found that you can optimize the mesh considerably if you join coplanar polygons with the same materials. You can look for long strips; my algo checked for very long strips first and then gradually decreased the 'search size' until only quads were left. In practice this reduced overall polygon count to less than 20%. For a software rasterizer, this might help performance significantly.
I've been doing some coding as well, and I stayed far away from ray tracing (for a change). Attached screenshot shows a procedurally generated world, using 12 octaves of Perlin noise, with some additional twists. You can zoom in on the landscape 2x, 4x, 8x and 16x, and in all cases, you get full detail (hence the 12 octaves). Landscape data is stored in 256x256 pixel tiles, and for the zoom levels, also in 128x128 tiles and so on, to reduce computation time when zoomed out.
I am not yet sure what I will do with it, maybe some biosphere simulator, with a vegetation simulation and flocks of animals (carnivores, herbivores). We'll see. Procedural is fun.
2D is on purpose btw. Landscape is somewhat based (by now: inspired by) this one: https://www.shadertoy.com/view/4slGD4 . Which is a totally amazing shader.
By the way, a while ago I dabbled with Minecraft worlds as well, and I found that you can optimize the mesh considerably if you join coplanar polygons with the same materials. You can look for long strips; my algo checked for very long strips first and then gradually decreased the 'search size' until only quads were left. In practice this reduced overall polygon count to less than 20%. For a software rasterizer, this might help performance significantly.
I've been doing some coding as well, and I stayed far away from ray tracing (for a change). Attached screenshot shows a procedurally generated world, using 12 octaves of Perlin noise, with some additional twists. You can zoom in on the landscape 2x, 4x, 8x and 16x, and in all cases, you get full detail (hence the 12 octaves). Landscape data is stored in 256x256 pixel tiles, and for the zoom levels, also in 128x128 tiles and so on, to reduce computation time when zoomed out.
I am not yet sure what I will do with it, maybe some biosphere simulator, with a vegetation simulation and flocks of animals (carnivores, herbivores). We'll see. Procedural is fun.

2D is on purpose btw. Landscape is somewhat based (by now: inspired by) this one: https://www.shadertoy.com/view/4slGD4 . Which is a totally amazing shader.
- Attachments
-
- world.jpg (169.67 KiB) Viewed 7147 times
Re: GRP2 discussion
I have seen that guy's YouTube videos before and they are indeed amazing. Your terrain looks really good as well, do you have any sources for terrain generation or is it just a lot of trial and error?
As for the mesh optimization, I now have an infinite terrain, so when the player gets to the edge of the map I have to generate meshes at runtime. This is kind of slow right now, even when using a memory pool, so I don't think adding extra checks in there will be beneficial (unless I multithread it, but the code is already quite complicated so I'm not going to).
I didn't do much visually since last time I posted because most time was spent on creating the infinite terrain. I did however add a few small things like trees and snowy mountains:


What I mostly want to focus on now is the terrain generation because it looks quite boring at the moment. After that I might want to add placement and removal of blocks
As for the mesh optimization, I now have an infinite terrain, so when the player gets to the edge of the map I have to generate meshes at runtime. This is kind of slow right now, even when using a memory pool, so I don't think adding extra checks in there will be beneficial (unless I multithread it, but the code is already quite complicated so I'm not going to).
I didn't do much visually since last time I posted because most time was spent on creating the infinite terrain. I did however add a few small things like trees and snowy mountains:


What I mostly want to focus on now is the terrain generation because it looks quite boring at the moment. After that I might want to add placement and removal of blocks

Tom Veltmeijer
Re: GRP2 discussion
Happy to say that I am finally feature complete too. Was stuck on a silly mistake for 3 days (yay me).
Complete with projection matrices and frustum clipping. Time to optimize the hell out of this.
Have some Wipeout.

Complete with projection matrices and frustum clipping. Time to optimize the hell out of this.
Have some Wipeout.

Re: GRP2 discussion
Managed to implement some old project into the rasterizer lol :

The right one is my very first project ever (Galaxians), the left one is my gauntlet assignment, and the middle one is my Raytracer.
You can fully complete the games and you can move around in the Raytracer.


The right one is my very first project ever (Galaxians), the left one is my gauntlet assignment, and the middle one is my Raytracer.
You can fully complete the games and you can move around in the Raytracer.

Re: GRP2 discussion
Final slides are online.
Mathijs, why didn't you demo?
Link to Ingo Wald's animation repository:
http://www.sci.utah.edu/~wald/animrep/s_en_index.html
Mathijs, why didn't you demo?
Link to Ingo Wald's animation repository:
http://www.sci.utah.edu/~wald/animrep/s_en_index.html
Re: GRP2 discussion
I would have, but sadly, I became ill today and missed the lecture
Re: GRP2 discussion
Hey Everyone,
As you are all finalizing the software rasterizer right now I might have a nice bonus for you guys to add!
The always excellent posts of Fabian Giesen share a view on texture tiling and swizzling. I am sure that Jacco has explained how this goes but its still a nice read. Also he wrote some sample code that might help you all with an implementation!
http://fgiesen.wordpress.com/2011/01/17 ... swizzling/
https://github.com/rygorous/vivante_swizzle
Also after seeing some screenshots and hearing about some of the coding from some of the people making their software rasterizers, it got me excited again!
Good luck with the finalization,
Cheers,
As you are all finalizing the software rasterizer right now I might have a nice bonus for you guys to add!
The always excellent posts of Fabian Giesen share a view on texture tiling and swizzling. I am sure that Jacco has explained how this goes but its still a nice read. Also he wrote some sample code that might help you all with an implementation!
http://fgiesen.wordpress.com/2011/01/17 ... swizzling/
https://github.com/rygorous/vivante_swizzle
Also after seeing some screenshots and hearing about some of the coding from some of the people making their software rasterizers, it got me excited again!

Good luck with the finalization,
Cheers,
Juul Joosten 110103
I like to write images and architecture.
I like to write images and architecture.
Who is online
Users browsing this forum: No registered users and 0 guests