shading language strategy

Bwain| No Comments »

Going to have to think of the next logical step for the shading language. That would have to be for loops, so that we could perform iteration for the escape time rendering. That’s definitely it. In the process of doing this simple example, I had implemented statement functions and variable assignments, which I hadn’t considered before. It was time well spent.


Subindexing Symbols

Bwain| No Comments »

I’ve got the printing working, and got to implement a utility that does all escape character substitution like /n and stuff like that.

But I’m seeing a shortcoming in my symbol definition. The symbol can only point to the start of the location of symbol data, it can’t differentiate between a vector[3] and vector[3][0]. This wasn’t a problem with all the different cases of operators and functions. But for something that’s highly overloaded like the ‘print’ commands, we need to be able to make this distinction. This will most likely break a lot of things, but luckily I came across this bug early on. Hopefully the fix will be relatively painless….

Ok, just looked at the assembly file definition, which can be found here. There are two ways that the symbol definition is used. They are declared in the SYMBOL section of the assembly file. This should stay the same. What needs to be changed is the way they’re referred to by expressions, and how they get written out in the assembly code stage.

Got the assembly file symbols to differentiate between referring to an entire symbol and a sub-component. This allowed for the print command to have properly overloaded arguments. Works fine!!

Now onto FOR LOOPS. But to get that, I should look into doing things like pre/post fix operators like ++/– and other operators such as +=/-=.

More thoughts…. pre/post fix operators such as ++ and — are for the shading language grammar, NOT the expression grammar. These operators have side effects and are not part of a pure expression language. On the other hand, what IS missing from the expression language are unary operators such as ‘!’ and ‘-’. These are important.

First print display

Still| No Comments »

I FINALLY got around to printing up a piece and my friend was nice enough to have it displayed in his bedroom. Cecil and Helen from soccermom have this over their bed. Click on it to see a higher rez version.

cecil_sm.jpg

Also have some .avi animations in 2k and ntsc resolutions. Requires divx to view. I should convert them to quicktimes or something with a more common codec. Windows users can use windows media, but mac users may have to download and use the divx viewer.

This project was an experiment with Pickover’s epsilon cross method. Basically, we count how many iterations it takes to arrive within a small distance to the real or imaginary axes. We can rotate the axes, offset the rotation with respect to the iteration number, do some spatial and temporal antialiasing, etc. This leaves us with the final result you see here. I coded this up in Vex COPS using Houdini. The goal will be to able to do this using shading language in spa.

Great read

Misc| 2 Comments »
pinchBeck

I’m reading ‘2012 The Return of Quetzalcoatl’ by Daniel Pinchbeck. You can get it here. It brings together many disparate things in my mind and wraps them up nicely. I’ll only include a quote here and let you check it out on your own…

Soon I found myself rematerializing in the musty Haight-Ashbury attic from which I had launched. Coming out of my trance, I looked down at my arm. Standing on my sleeve was an intricate metropolis, a science-fiction city of glittering spires and emerald skyscrapers in which I could almost see the movements of an infinitesimal transport grid. I looked around at my friends sitting in a circle around me, and all of them appeared radically transformed. They were themselves, but patina’d with complex multicolored tattoos, sporting celestial headdresses, prismatic auras, and elaborate comic-book-superhero armatures. The thought occurred to me that we were actually space aliens or cosmic deities who had projected ourselves backward into this time, prearranging this crude but amusing encounter in “meat-space” from our holographic homeland. “Everyone is God,” I muttered as the vision faded away.

Diversion

Misc| No Comments »

I got an idea to combine mandelbrot stalks, a basic Mandala, some space invaders characters, and possibly one of the mooninites. The intension was to use the shading language for everything, but it’ll be a long time before its ready to do anything that useful. So I’m just creating c++ operators to do it. I hope it comes out nearly as cool as I’m visualizing it in my head….

si.jpgmooninites.jpg

Ok, maybe no mooninites, but definitely the space invader sprites.

Supersampling

Bwain| No Comments »

So I guess its good to fix things along the way. I realized that I needed two different ways to detect the need for supersampling. One is by taking a regular contrast measure between neighboring pixels, but for fractals that have ultrathin filaments, more analytical methods are needed. Specifically, I need for the supersampling to be triggered by either pixel contrast or an image map. In implementing that, I found a bunch of inefficient code, so I started cleaning it all up, and now its FUCKED. In the end, I’ll have something more flexible and appropriate for fractals.

Ha ha

Ok works now. To do the supersampling mask, I need to know the projected pixel size in the complex plane, and how it changes as I iterate. So I added an automatically calculated parameter to the camera operator so I can refer to it from the escape time operator.

Back to SIMD

Bwain| No Comments »

I’m at the point where I need some simple operators to do things mask and composite the resulting elements. Operators that are made up of very basic expressions, with no control flow. So this would be perfect to get the simd operator in the imgNode library to handle.

The first design element I left out is a way to handle an arbitrary number of inputs. For this case, I only need two, but it would be best to handle as many as needed. Since the colors are packed seperately in memory, not as tuples, I’m thinking that we could define (r,g,b) for the first input, (r2,g2,b2) for the 2nd input, etc.

When the shading language matures, we’ll have to find a way to have the shading language define a function to specify the number of inputs, number of colors per input, etc.

HMMM… unary operators haven’t been FULLY implemented. There is a bug where the parser gets confused between the binary operator ‘-’ and the unary operator ‘-’. I don’t think the SIMD commands were ever fully implemented.

I can’t divert too much time for fixing the shading language and the unary/binary operator discrepancy. I’ll be hand-coding the .asm files to do the masking/invert operators. For now, its enough to generalize the Smd operator to handle multiple inputs. The Smd operator was hardcoded to only operate as a source, not as a filter. Got that working.

Unary Operator Solution

Bwain| No Comments »

There is a sample grammar called YAC, which stands for “Yet Another Compiler”. It handles variables and fuctions, and has a lot of high level Spirit functionality. It also has a very clean expression grammar which handles unary and binary operators, along with variable assignments, functions and more. It can be found here. This could be a good template to follow to help with the binary/unary operator problem I’m having.

Blur

Bwain| No Comments »

Got the max working via SIMD code, and it was compiled using ‘lcc’, not hand coded assembly code. Problem: the sprite is too sharp, and doesn’t fit into the ring image space at all. I’ve avoided this long enough, but I have to code up a blur operator.

A typical 2D convolution gets optimized by separating each dimension into a separate pass. But that should effectively create an anisotropic blur kernel, which sucks. Don’t know if I need to do full 2D convolution or not. Maybe leave the option for both??

Turns out that implementing both wasn’t a stretch. What’s interesting is that the triangle filter isn’t separable, (the single/dual passes come out different) but the gaussian filter is separable. As advertised, the dual pass is computationally superior.

Here is an example of the sprites+blur+rings. I’ll be combining this with mandelStalks, just as soon as I enable the crop operators to use certain expression variables.

si_0.png


Space Invaders

Anim| 1 Comment »

Thinking of ways to combine old-school imagery with new. What more expressive archetype than the space invaders characters?? Ancient glyphs representing the FIRST time we saw computers as entertainment in the back of some old bar in the 80s? Click on the image to start the player. You can download the full rez version here.


Copyright © 2010 Luna-Canis | Created by miloIIIIVII
Top | Sidebar | Sitemap | Disclaimer | Network