Pages

Thursday, April 23, 2015

Now Drawing 200,000+ blocks!

It's been a while because I have been trying out all kinds of optimization ideas. Using instancing per block type (and thus giving up depth based drawing, for now), every frame, 200,000+ blocks with randomly assigned block types, face rotations, and colors are drawn with constantly updating positions and 360 degree rotations, without lag! There is also global lighting with 4 general direction spot lights and 1 universal ambient light.

Also, I greatly improved the color variations (within each block) and was finally able to get multisampled anti-aliasing (MSAA) to work!

Eighteenth step complete:

Tuesday, April 7, 2015

Added Lighting and FPS and Drawing 160,000+ Blocks Per Frame!

We now have Lambertian (aka. long distance directional) lighting and ambient lighting, as well as a set FPS (Frames Per Second)! Also, Fragile can draw about 160,000+ blocks per frame without lag, with each block drawn per frame having its own randomized block type, rotation, and color. This is demonstrated in the video below.

I ran into some problems with sending data to the GPU (Graphics Processing Unit) that took me hours to figure out: it turns out you have to pad data sent to the GPU in order for it to transfer properly. Yuck.

One interesting note is that Fragile can draw about 1,000,000 of these blocks with mild lag (choppiness and somewhat slow response time to input), but it is doable.

Seventeenth step complete:
(lighting from below)



Up next: storing the entire game world (units, components, etc.) and map in memory without using up a lot of RAM (Random Access Memory - aka. the memory applications use while running) but with quick response time. REGHEX and I have figured out a good system for this; I just have to implement it well.

Sunday, March 29, 2015

Free View Camera Movement using Keyboard and Mouse Input

That's right, a free view camera has finally been coded, using keyboard and mouse input! To demonstrate its functionality, I have created a Youtube channel as well as a Google+ account for Fragile. I've also likewise started to increase the potential to build notoriety for Fragile, making about pages and FAQ's and such.

The movement was extremely smooth, even while I was recording at 60 FPS with Fraps. It's sort of choppy in the video though. One thing that was interesting was that with my unregulated-FPS code, it was automatically rendering between 170-220 FPS! :O So the performance is excellent.

Sixteenth step complete:

I still need to add lighting...

Saturday, March 28, 2015

5 Block Types with Rotations and Minor Outlining

I organized the code a lot, but I can't really show that as eye candy... I did however make a lot of eye candy changes. There are now 5 block types (as opposed to just the one block type, a cube, from before): cube (8 vertices), inverted corner (7 vertices), prism (6 vertices), square corner (5 vertices), and tetra (4 vertices). These are depicted in the screenshots below.

Due to the difficulty of seeing the triangular portions of these block types, I also decided to dual draw every cube, the second time in wireframe mode with a slight color highlight (slightly whiter color) and a varying alpha value. The goal with this color was to make it blend in with the cube color but be somewhat noticeable on triangular edges. Hopefully lighting will fix this problem altogether, but it still looks pretty good.

Fifteenth step complete:



Up next: converting the project to x64 (might as well since we're using DX10+...) and much needed lighting!

Monday, March 23, 2015

Per-Block Dichromatic Directional Coloring with Automatic Color Variation

This is an extremely significant accomplishment for the game's progress! There is now per-block dichromatic directional coloring (so that blocks have "direction": forward, backward, left, right, up, or down) with automatic color variation (for distinguishment between adjacent same-colored blocks).

It's also noteworthy that:
  1. Variance of transparency levels within a block (between its two colors) is possible and is demonstrated in the first two pictures below.
  2. All color variations and directions are automatically calculated in the GPU (in other words it's fast).
  3. Wireframe mode is possible (and was possible since the last update, but I forgot to demonstrate it) and is shown in the third picture.
  4. In the last three pictures:
    1. The camera is rotating around the blocks while simultaneously shifting up and down.
    2. There are 4 different colors (and associated transparencies) being drawn, two of which are for a single cube color combo (green and red).
    3. Though the facing of all of the green and red blocks is specified explicitly, 5 of the 6 possible directions for a block to face are depicted.
Fourteenth step complete:



I am very happy to see these results. Up next is probably lighting or anti-aliasing.

Sunday, March 22, 2015

Rotating Camera Around Shaded Transparent Blocks

Wow! This looks absolutely beautiful! So, I took four pictures at different angles and transparencies. :D

Thirteenth step complete:




This code rotates the camera counter-clockwise (from above) around the blocks and continually aims the camera at the center of the blocks.

Next we will need to separate the color and vertex data from the D3D initialization code in order to draw different colors, shapes, and transparencies. Also, I will continue to work through the final tutorials on lighting and textures, which will hopefully get me to the point where I can design my own HLSL shader code (along with the c++ to interact with it) and maybe my own effects, lighting, multisampling, anti-aliasing, etc...