Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - rain_storm

Pages: 1 2 3 4 [5] 6 7 8 9 10 11 12 ... 69
I wouldn't worry bout it too much I recently sent a standard Hello World MessageBox (exe and fasm source file included) to Avira demanding to know exactly why it raised a false positive. They told me they would look into it. Had to ditch that damn AV it was messing with my me time.

The startup effect reminds me of those magic motion cards from our childhoods. And the edge detection looked almost like chalkboard, Kudos for using an exe icon of a bog roll and k++ for the false positive (great to see packers being used for non size constrained compo). This entry rocks partly for the right reasons and partly for the wrong ones.

Awesome effects very interesting stuff for me as I am currently looking into dithering and colour quantization. A shame I don't have a webcam to test but thanks for including an option for loading files.

Awesome work Shocky.

Looks the biz

Projects / Re: Voxel Engine
« on: July 09, 2011 »
The current direction I'm moving in is to increase the level of detail. I now have octrees and the fast 3D DDA working together. with mip mapped geometry. It's a lot slower though. But first you gotta make it work then you can make it fast.

Coding tutorials / Re: Introduction to ASM
« on: July 08, 2011 »
512b GDI Framework will allow you to push some pixels on Windows 7.

BTW this is very misleading...
Now we want to enter the infamous "Mode-X", and we can do so by typing;
Mode X is a number of non standard compliant video modes including 320x240 up to 360x480 and operates in planar memory (unchained) mode. The video mode used in this tutorial is Mode 13h which is 320x200 chained. Mode X is only possible by bypassing int 10h and setting up the video mode manually by manipulating the VGA registers.

merely interpolating the colours by taking the average works well, but only if the framerate is already high enough (say 25fps being boosted to 50fps). When the camera stops moving the effect disappears but when the scene is in motion it helps greatly to keep things greasy fast.

General chat / Wow
« on: July 07, 2011 »
This speaks for itself...


Projects / Re: Voxel Engine
« on: July 05, 2011 »
Thats fairly impressive JL235 but the engine quaters the resolution internally so you're getting 10-15 fps at 960x540. The most important optimization is the quadtree subsampling, it scales logarithmically with resolution. If you double the resolution the framerate doesn't drop by half. I've switched from quadtree to bintree subsampling. It's still a little glitchy but I've managed to double the framerate without having to spawn more threads.

I've managed to implement octree's using the Parametric Octree Traversal Algorithm but the recursion is crippling the framerate. I could try to convert this from recursive to iterative and manage a stack by myself but to be honest the initial results are so underwhelming that I don't think it's worth it. So I'm gonna investigate mipmapping the voxel geometry and see where that takes me.

my octree traversal looks like this

Code: [Select]
#include "raytrace.h"
#include "octree.h"

unsigned char a;

int RayOctree(octree tree, photon ray)
    // force positive traversal direction...
    a = 0;
    if (ray.dirx < 0.0f) {
        ray.posx = tree.sumx - ray.posx;
        ray.dirx = -ray.dirx;
        a |= 4;
    if (ray.diry < 0.0f) {
        ray.posy = tree.sumy - ray.posy;
        ray.diry = -ray.diry;
        a |= 2;
    if (ray.dirz < 0.0f) {
        ray.posz = tree.sumz - ray.posz;
        ray.dirz = -ray.dirz;
        a |= 1;

    // calculate slab intersections...
    float tminx = (tree.minx - ray.posx) / ray.dirx;
    float tmaxx = (tree.maxx - ray.posx) / ray.dirx;
    float tminy = (tree.miny - ray.posy) / ray.diry;
    float tmaxy = (tree.maxy - ray.posy) / ray.diry;
    float tminz = (tree.minz - ray.posz) / ray.dirz;
    float tmaxz = (tree.maxz - ray.posz) / ray.dirz;
    // continue only if ray intersects bounding cube...
    if (Max(tminx,tminy,tminz) > Min(tmaxx,tmaxy,tmaxz)) {
        return 0;
    return RayNode(tminx,tminy,tminz, tmaxx,tmaxy,tmaxz, tree.root);

int RayNode(float tminx, float tminy, float tminz, float tmaxx, float tmaxy, float tmaxz, node *n)
    // the octree traversal is dependant on positive direction rays...
    if (n == 0 || tmaxx < 0.0f || tmaxy < 0.0f || tmaxz < 0.0f) {
        return 0;

    // if we reach an atom we are done...
    if (n->type == NODE_ATOM) {
        return RayVoxel(n);

    // otherwise subdivide this node into 8 children...
    float tmidx = 0.5f*(tminx + tmaxx);
    float tmidy = 0.5f*(tminy + tmaxy);
    float tmidz = 0.5f*(tminz + tmaxz);

    // find the first node entered...
    int curNode = FirstNode(tminx, tminy, tminz, tmidx, tmidy, tmidz);

    // travarse the rest of the child nodes using the current node and exit planexyz...
    int rgba = 0;
    do {
        switch (curNode) {
        case 0:
            rgba = RayNode(tminx, tminy, tminz, tmidx, tmidy, tmidz, n->child[a^0]);
            curNode = NextNode(tmidx, 4, tmidy, 2, tmidz, 1);
        case 1:
            rgba = RayNode(tminx, tminy, tmidz, tmidx, tmidy, tmaxz, n->child[a^1]);
            curNode = NextNode(tmidx, 5, tmidy, 3, tmaxz, 8);
        case 2:
            rgba = RayNode(tminx, tmidy, tminz, tmidx, tmaxy, tmidz, n->child[a^2]);
            curNode = NextNode(tmidx, 6, tmaxy, 8, tmidz, 3);
        case 3:
            rgba = RayNode(tminx, tmidy, tmidz, tmidx, tmaxy, tmaxz, n->child[a^3]);
            curNode = NextNode(tmidx, 7, tmaxy, 8, tmaxz, 8);
        case 4:
            rgba = RayNode(tmidx, tminy, tminz, tmaxx, tmidy, tmidz, n->child[a^4]);
            curNode = NextNode(tmaxx, 8, tmidy, 6, tmidz, 5);
        case 5:
            rgba = RayNode(tmidx, tminy, tmidz, tmaxx, tmidy, tmaxz, n->child[a^5]);
            curNode = NextNode(tmaxx, 8, tmidy, 7, tmaxz, 8);
        case 6:
            rgba = RayNode(tmidx, tmidy, tminz, tmaxx, tmaxy, tmidz, n->child[a^6]);
            curNode = NextNode(tmaxx, 8, tmaxy, 8, tmidz, 7);
        case 7:
            rgba = RayNode(tmidx, tmidy, tmidz, tmaxx, tmaxy, tmaxz, n->child[a^7]);
            curNode = 8;
        if (rgba) return rgba;
    } while (curNode < 8);
    return 0;

int RayVoxel(node *n)
    // here I just return a colour, but this could just as easy be a list of objects to test.
    return n->rgba;

int FirstNode(float tminx, float tminy, float tminz, float tmidx, float tmidy, float tmidz)
    int index = 0;
    if (tminx > tminy && tminx > tminz) {
        if (tmidy < tminx) index |= 2;
        if (tmidz < tminx) index |= 1;
    } else if (tminy > tminz) {
        if (tmidx < tminy) index |= 4;
        if (tmidz < tminy) index |= 1;
    } else {
        if (tmidx < tminz) index |= 4;
        if (tmidy < tminz) index |= 2;
    return index;

Code: [Select]
// contents of raytrace.h
typedef struct photon {
float posx;
float posy;
float posz;
float dirx;
float diry;
float dirz;
} photon;

// contents of octree.h
typedef struct node {
node *child[8];
int  type;
int  rgba;
} node;

typedef struct octree {
float  minx, maxx, sumx; // where: (minx < maxx) && (sumx = minx + maxx)
float  miny, maxy, sumy; // where: (miny < maxy) && (sumy = miny + maxy)
float  minz, maxz, sumz; // where: (minz < maxz) && (sumz = minz + maxz)
node   *root;
} octree;

const int OCTREE_NULL   = 0;
const int OCTREE_ROOT   = 1;
const int OCTREE_BRANCH = 2;
const int OCTREE_LEAF   = 3;

and the octree data looks like this
Code: [Select]
node n[8] = {
{ 0,0,0,0,0,0,0,0,NODE_ATOM,0x003333FF },
{ 0,0,0,0,0,0,0,0,NODE_ATOM,0x00FFFF33 },
{ 0,0,0,0,0,0,0,0,NODE_ATOM,0x00FF33FF },
{ 0,0,0,0,0,0,0,0,NODE_ATOM,0x00FF3333 },
{ 0,0,0,0,0,0,0,0,NODE_ATOM,0x0033FFFF },
{ 0,0,0,0,0,0,0,0,NODE_ATOM,0x0033FF33 },
{ 0,0,0,0,0,0,0,0,NODE_ATOM,0x00FFFFFF },
{ 0,0,0,0,0,0,0,0,NODE_ATOM,0x00333333 }
node root = { &n[0],0,0,&n[3],0,&n[5],0,0,NODE_ROOT,0x00FF7733 };
octree tree = { -1.0f,1.0f,0.0f, -1.0f,1.0f,0.0f, -1.0f,1.0f,0.0f, &root };

Thanks guys. That bock motion compensation looks like it's worth trying out. I hear that lag is a problem with interpolation so you cannot boost a low framerate from 12 fps to 24, but when you're talking about demos lag is hardly an issue. At speeds of 30 fps the lag would be barely noticable.

General coding questions / Frame interpolation?
« on: July 05, 2011 »
How would you go about interpolating inbetween frames from a before and after? Best I can think of would be to choose a pixel, take the colour before add the colour after and average the two to create an inbetween. Is there a better solution?

Projects / Re: Raymarching Beginners' Thread
« on: July 05, 2011 »
I came across this link, its got some awesome algebraic raytracing worthy of a read:

Yabasic / Re: Inkey$ in combination with 'if'
« on: July 03, 2011 »
In your code the initial call to inkey$ has a timeout of 1 second. after which execution falls through to the if statements. In each if statement you make a further call to inkey$ but this time without a timeout argument, the program waits forever for a keypress at each of those if statements. The solution is to store the initial result of inkey$ in a variable and use the variable instead...

Code: [Select]
key$ = inkey$(0)
if (key$="left") then
elsif (key$="right") then
elsif (key$="up") then
elsif (key$="down") then

A ps2yabasic entry would be awesome! Good luck to everyone that enters.

I think a month is more than enough. There's always fair warning given that a compo is coming up, if people are interested than they will stayed tuned in and start designing as soon as it they know the requirements.

General chat / Re: Zero to Shitty in ten minutes.
« on: June 24, 2011 »
Not good. Hope it gets better for you in time.


General chat / Re: Birthday thread...
« on: June 24, 2011 »
happy bday buddy

Projects / Re: Voxel Engine
« on: June 23, 2011 »
Updated - Quadtree subsampling now works with texture mapping, Added extra shapes, now it supports discs, spheres, capsules and cylinders, and increased the maximum number of shapes to 256.

These extra shapes are only partially implemented. Collision detection is still performed as though all shapes were spheres. So there may be some overlap between shapes. Also the objects are not yet added to the link list based on their volume this can cause artifacts where parts of a shape are not displayed correctly.

Pages: 1 2 3 4 [5] 6 7 8 9 10 11 12 ... 69