Global Illumination Progress Update

The Global Illumination by Light Propagation Volumes is progressing in a nice way. Even though this is an artifact in a weird way, it still produces a nice result. The surface is too thin for the grid to not capture both sides. Posted Image But it looks nice.

gi

But not all is good, there’s still weird artifacts:

Sometimes the shadow testing fails when injecting lighting into the grid, I guess this is to do with the resolution but I’m still not sure, I think there’s more to it. Example: The shadow testing should have succeeded, but no indirect illumination is present.

Light Bleeding:

Advertisements

CELL – First try at a scripting language

So, before anyone jumps on the “dont make your own language” wagon, I’m only trying this because I thought it would be an interesting challange and it’d be a great oppertunity to understand how other languages work on the inside.

I’ve attempted it before, but gave up about 20 minutes in, so a few days ago I tried again. But this time I decided to go with boost spirit instead of bison, hoping that it would be easier. And it turned out it was, for me at least. So, the name! The most important part of anything! Right? So I kept thinking about some awesome names, and thought of CELL, but, so then I decided what the C, E, L, L should actually mean. So, I have an engine called Cuboid Engine, thats CE, now LL… Lightweight language! There we go! Cuboid Engine Lightweight Language, brilliant! Now I have to actually create the language.

So it’s a pretty basic setup. Using boost spirit to parse the input, compile it into tokens then do stuff with the tokens which are then translated into instructions, a list of instructions more specifically. These instructions can then be passed to the virtual machine, which works in a “stack” manner.

So it’s still pretty damn basic, but, I got a few things working:

  • Variables
  • Functions
    Arguments, Return values, Multiple Return values ( Which can be of different types )
  • Classes ( No functions yet though Posted Image )
  • External functions ( like in c++, can also be external functions from objects in c++ )
  • Local and Global Variables
    ::var <- local , local : var <- local , global : var <- global
  • If, For and While stuff
  • Logical Operators and and or
  • different assignment stuff ( += , -= *= bla bla bla )
  • And some minour stuff

Examples:

class Foo
{
    ::var = 5; // this works as a static
               // and the // is comments
};

// call external function
print("Foo value:" & ::Foo.var);
function GetAnswer()
{
    return [42];
}

function GetArrayOfAnswers()
{
    ::ans = GetAnswer();
    return [::ans,  ::ans];
}

[::ans1, ::ans2] = GetArrayOfAnswers();
print(::ans1 & ::ans2); // ouputs: 4242
function DoComputation()
{
	::comp = 412 * 0.15 + 0.85 / 43;
}

::max = 50000;
for(::i = 0; ::i < ::max; ++::i)
{
	DoComputation();
}

Yeah you get the idea… Posted Image

Hopefully I’ll get the functions implemented.

Light Propagation Volumes

So a while ago I implemented a pretty neat feature, theres still bugs, due to the voxelization not being “fully” functional. Apperantly when the surface normal is parallel with the camera viewport of the voxelization cameras, the voxelization fails completely.

The following screenshot in the result from the Light Propagation Volume only, the GI Effect is oversaturated for effect and the sponza scene is voxelated using an 32x32x32 grid, so the result is limited, I’ll try later with a higher resolution.

Oversaturated GI

Next Step: Voxel Cone Tracing! 🙂