Pixel Shader for newbies (sandbox)

Hi there!
I’ve recently found some pixel shaders by syfenx…as they probably need some work to make them more attractive, I decided to put them in the User shader gallery as templates for a little place called PS sandbox…I’m currently workin on some changes that can be done…so if you have any ideas don’t hesitate and post there some of your works on them or every others(this includes especially all mine which are still in early versions…).Then we could discuss what is possible inside PS, show tweaked code, ask questions …don’t be shy, somebody here will have a pleasure of answering…There is already a pixelshader_for_newbies but anyways, one of the most efficient known way to learn vvvv is messing up with existing work…so i invite you to mess our shader gallery and create or at least learn more about shaders…knowledge is power!

notice : This is a place for PS and will help to create pixelshadertutorial… would be interesting to do the same for VS.

Hi again :]
I made some tests with a textured version of the gradient shader…There is the result…
Displacement of an input texture by gradient transformsmations…two versions to understand better what’s possible here (but not exhaustive!)…First one is simple displacement, second one diplace inside the texture input and returns it to keep the shape…Interesting and psychedelic things can be done.I hope it’s simple, understandable and will help you to learn some PS tricks…have vvvvun!!!

Gradient_textured.zip (29.5 kB)

Hi all,

I found a shader from Nvidia developper site (Negative.fx) and would like to use it in vvvv, so I need to tweak a couple things. The first problem I encounter comes from the Quad.fxh file that cannot be loaded from my Shaders folder (whereas this fxh file is in the folder).

S is there a way to fix that?

Thanx all of you,
Alecz

post_negative.zip (743.9 kB)

i just opened that quad.fxh in a texteditor and replaced that “include quadblabla” with that text. as a start this works.
but there is some more work to do.

btw: i think modifying another PS will be more easy to achieve that “negative color” effect.

in the HLSLfolder is a small patch now

post_negative.zip (746.4 kB)

Ok, thanks kalle.

I made a negative shader from Template.fx and the post_negative from nvidia. Here it is but I will try anyway to make it the hard way thanks to your help.

Cheers!!!
Alecz

Negative.fx (3.2 kB)
Negative.rar (3.0 kB)

try changing lines 465 and 470 from

VertexShader = compile vs_2_0 ScreenQuadVS();
PixelShader = compile ps_2_a negativePS();

to

VertexShader = compile vs_1_0 ScreenQuadVS();
PixelShader = compile ps_1_0 negativePS();.

that should make it.

btw:

take “Constant.fx”, save as “Negative.fx”

and insert
col.rgb= 1-col.rgb;
between
float4 col = tex2D(Samp, In.TexCd) * cAmb;
and
return col;

save again, and there you are… :)

Great, thanks man! Here is a negative shader simply made from vvvv’s template and nvidia’s post_negative. Just added 2 lines.

So that’s the easy way but I’m trying to do it the hard way thanks to your help.

Cheers!!!
aR

Negative.rar (3.0 kB)

try changing lines 465 and 470 from

VertexShader = compile vs_2_0 ScreenQuadVS();
PixelShader = compile ps_2_a negativePS();

to

VertexShader = compile vs_1_0 ScreenQuadVS();
PixelShader = compile ps_1_0 negativePS();

Actually changing PS from 2.a to 2.0 also works.

Notice: You just need to declare tWVP…other transforms are useless there…

Post-Negative.zip (2.1 kB)

Check this one…Uses 2 textures and some negative blending effect…

Inverse_2textures.zip (3.2 kB)

I’d call this one “TexCtrlInversion.fx” and the texture inputs “Texture” and “Control Texture”

fine like everything from desaxismundi… :)

Wouaouh… Didn’t expect that!
Thanx kalle, nice variation about the simple negative idea!

Alecz

IMHO we should start a new thread for each shader.
this thread here will get very long soon.
my suggestion is starting the Topic’s with SANDBOX

and you know what?
i’m starting right now…

aaah, accidentally i attached something here…

ThinFilm (nVidia).zip (888.6 kB)