Alpha Pins for all default shaders

it would save a lot of time if all the default shaders would be shipped with an extra alpha pin.
fading things in and out is quite common, so pleeeeease.

i am pretty sure that you know how to add this little code to any shader.

for all others:
add these two lines to your shader to achieve this.
click pics for full size

I think the second Line should be:

col.a = col.a * iAMtheAlphaFloat;

or shorter
col.a *= iAMtheAlphaFloat;

Otherwise you would just overwrite an already given alpha.

But anyways one of the devvvvs could make this changes and make them available with the next release, so one has not to do it repeatedly everytime when converting to new vvvversions.

yes, making the alpha pin default would be great because…

  • saving time (not adding the pin everytime again and again…)
  • projects must not be shipped with extra shaders, just because of the alpha pin. default shaders can be used.

despite the name iAMtheAlphaFloat i would say this is a good idea…

i opened the effects folder for all: AddOns.Contribute

so now anybody can contribute to the effects folder.
lets just discuss changes here or in the shader forums before.

what about

iAmAReallySillyFloatNameSuggestedByAGuyWhoIsWayTooOldToPlayAroundWithVVVV ?

You can also use a color transform on most shaders to apply alpha to it

you can tidy this up to just the SetMatrix and SetSlice once you’ve got it working

nice hint sugokuGENKI! but the ColorTransform pin is also not a default pin in every effect.

so i’ll start adding some Alpha pins (life tf already did!). I’d suggest to add them also to Constant (EX9.Effect) - even if he can do it already via tha Alpha from the ColorInput - to establish the pin as a standard.
(what about Template (EX9.Effect) which has no colors at all?)

done for:


not done for:

CubeTexture.fx (shader structure confuses me)
FlatDirectional.fx (shader structure confuses me)
FlatPoint.fx (shader structure confuses me)
Template.fx (not sure if it makes sense)
Template3x3.fx (not sure if it makes sense)
Undistort.fx (not sure if it makes sense)

hmm. sorry for being late here, but having a ColorTransform pin on all the shaders would be much more helpful & exciting than just the alpha pin (and many people will understand what ColorTransforms actually are as soon there is at least one default shader with a ColorTransform pin.

For doing fading effects, Constant 2.0 is a shader predestined for those tasks - and this one already features a a Color Transform pin by default.
For shaders that are preferred for 3D stuff, like ‘Phong’, I wouldn’t suggest to have an alpha option. This would probably lead to confusion as lack of knowledge about drawing order of polygons in transparent objects might be wide spread among people that are new to 3D rendering.

i would tend to agree with oschatz and sven here. the color transform is more versatile and other alpha values than 1 confuse the depth buffer and new users. so a color transform pin should be the best. so i added an alpha pin to the more or less unknown node HSL (Transform) .

only thing is, one matrix vector multiplication is 16 multiplications and 12 additions. althought this is an optimized operation on graphics cards, the multiplication of the alpha channel is just 1 flop…

i’m not sticking to the concept of the additional alpha pin, if it can be done easily with the HSL (Transform) .
so we agree on ColorTransform pins except of the Alpha pins for the next release?

(although, the existence of the Constant_2.0 only irritated me so far.)