Archive for January, 2008

31
Jan
08

Vertex Noise Fun

I’ve been having fun messing around with the Vertex Noise shader from the GLSL Orange Book.

I took the Quartz Composer version from the QC 3.0 Developer Examples folder as a starting point, and added some new features and tweaks.

Here are some examples of the shader’s output:

Vertex Noise Edit 310108 01Vertex Noise Edit 310108 02
Vertex Noise Edit 310108 03

OpenGL sometimes has problems showing the back faces through the transparent areas (an issue known as z-fighting), so rendering is a bit glitchy at times, but it’s still quite cool.

I’ve added inertia to all the controls too, which makes using it more fun, I think!

31
Jan
08

Vertex-Displacement Test 01

I though I’d have a go at displacing some vertices in GLSL.

It was surprisingly easy!
Of course, I’ve not done anything fancy like recalculating the normals, so I guess lighting effects wouldn’t work properly.

Nice way of distorting the image in 3D space though.

Vertex Displace Test 03Vertex Displace Test 02
Vertex Displace Test 01

30
Jan
08

SuperSmear New options

I’ve been talking to Ed again about possible additions and tweaks to the SuperSmear effect. We’ve managed to add the ability to change the effect from a smear effect, to a mirror effect, and back to the original image.

We’ll be working on a new, simpler control system for the effect.

superSmear 01superSmear 02
superSmear 03

22
Jan
08

Intel/PPC Weirdness Fixed (but not on my G5)

Well, it looks like there’s something odd about the eBay-bought GeForce graphics card on my G5. I’ve asked a couple of people to test my VVVVGradients composition on their machines, and everything has worked fine for them. It works fine on my MacBook Pro, and has now been tested on a G5 iMac running 10.5, on which it also works fine. On my G5, however, this happens…

picture-3-10.png

..the right side of the image disappears, whenever I turn on a particular option.

It should look like this:

picture-2-24.png

21
Jan
08

VVVVShader Clip

QuickTime, 9mb.
Kindly donated by l1nk-dna of MLVisuals.
VVVVGradients Shader Test.

21
Jan
08

Intel/PPC Weirdness Fixed?

I think I may have fixed the Gradients shader below.
Thanks are due once again to -NiCo- from the OpenGL GLSL Forum for pointing out an uninitialised variable in my converted code that I think was the cause of the weirdness in the previous post. I’ve yet to test it on my G5 at home, but on my MacBook Pro, my QC GLSL version of the shader is now producing more-or-less the same output as the original HLSL effect running in vvvv.

One thing I didn’t twig earlier is that while the suggested ranges for the controls in the vvvv plugin are quite wide (0 to 1000 or -1000 to 1000), the actual usable range is much more limited, with most of the image turning into basically random-looking noise quite quickly when the controls are turned-up. Set to such a large range, the QC sliders simply don’t have the resolution to create the more subtle effect seen in the screenshots. I’m considering including a ‘range’ slider to premultiply all the controls for courser or finer-grained control.

Quartz Composer / GLSL

mbp_qc_2.jpg

vvvv / HLSL

mbp_vvvv_2.jpg

The only major difference between the outputs from vvvv and QC (apart from the colours) is that they’re flipped vertically in relation to each other. I flipped one of the screenshots for easier comparison. I guess coords in vvvv start at bottom-left, rather than top-left, as they do in GLSL.

I’m going to email the guy who wrote the effect, and see what he thinks about me posting the GLSL code and the original HLSL here. Don’t want to post it here without contacting him first.

20
Jan
08

Intel/PPC Weirdness

Same QC Patch
Identical settings
Same MacOS version (10.5.1)
Same QuickTime version (7.4)

G5

g5_qc.jpg

MacBook Pro

mbp_qc.jpg

What the f*ck….?

Incidentally, this is the original HLSL shader, running in vvvv under XP on the MacBook Pro. Same settings (apart from the colours):

mbp_vvvv.jpg

Clearly, I’m doing something wrong in my code, but then again, I shouldn’t be getting such COMPLETELY different results on the different computers….

18
Jan
08

HLSL to GLSL

I’ve been attempting to convert an HLSL Pixel Shader from the VVVV website, into a GLSL Fragment Shader, with what could be termed ‘mixed success’.

I’ve managed to convert all the variables, and was hoping that the underlying algorithms, which I left exactly as they were, would produce a usable result. I haven’t managed to get anything like the screenshot on the website. I don’t understand the mathematics, so I have no idea where to start debugging it.

A useful exercise, maybe, but not entirely a successful one.

18
Jan
08

ScribeFire Test

Just testing ScribeFire, a blogging plugin for FireFox.I’m hoping it will solve my line/paragraph break annoyance.

16
Jan
08

Swizzling

My simplest effect yet. Simply mixes from original image to two different channel-shifted variants, then back to the original image.

The key is the ‘.’ swizzle operator, which allows the Red Blue, Green and Alpha channels of the image to be rearranged. Also notice that the Mix variable goes from 0.0 to just less than 3.0, and I use the fract function to extract the part of the number after the decimal point, and use this to mix between 2 variants, as well as to swap the start and end of the mix operation with values above 1.0 and 2.0.

Simple, but cool.

/*Inputs:
Image: input image
Mix: mix between original and channel-shifted variants. Range 0.0 > 2.999
*/

kernel vec4 swizzler(sampler Image, float Mix)
{
vec4 pix = unpremultiply(sample(Image, samplerCoord(Image)));
vec4 outPix = (Mix <= 1.0) ? mix(pix.rgba, pix.brga, fract(Mix)) : (Mix <= 2.0) ? mix(pix.brga, pix.gbra, fract(Mix)) : mix(pix.gbra, pix.rgba, fract(Mix)); return premultiply(outPix); }[/code]




January 2008
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  

Links

Blog Stats

  • 502,082 hits