» it.Tutorial Effects - Pixelshader, i preparativi
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

it.Tutorial Effects - Pixelshader, i preparativi

English | Spanish | Mandarin | French | Japanese

The original english version of this page is newer and may contain information this translation does not have! Click here to view the english version.

INDICE: it.Of Effects and Shaders
Prossimo: Gestire il colore


Per tutti gli esempi di pixelshader verrà usato lo stesso setup di base della patch con un nodo Grid (EX9.Geometry) 2X2 ed un nodo FileTexture (EX9.Texture) connessi ad un effetto; il pin View Transform del renderer viene scalato al doppio, così che la griglia occupi tutta la vista:

Invece che il nodo Template cloneremo un nuovo effetto come descritto nella pagina it.EX9 Effect Template. Connetti l'effetto appena clonato come mostrato nella patch e apri il CodeEditor con un clic del tasto destro del mouse sul nodo. Quindi copia il codice qui sotto e rimpiazza quello già presente nell'effetto (questo è più semplice in quanto lascia fuori la parte sui vertexshader, che per ora non verrà trattata).

//texture
texture Tex <string uiname="Texture";>;
sampler Samp = sampler_state    //campionatore per il lookup della texture
{
    Texture   = (Tex);          //applica una texture al campionatore
    MipFilter = LINEAR;         //stati del campionatore
    MinFilter = LINEAR;
    MagFilter = LINEAR;
};
 
//la struttura dati: "vertexshader to pixelshader"
//è usata come output dati con la funzione VS
//e come input dati con la funzione PS
struct vs2ps
{
    float4 Pos  : POSITION;
    float2 TexCd : TEXCOORD0;
};
 
float4 PS(vs2ps In): COLOR
{
    return 1;
}
 
technique TSimpleShader
{
    pass P0
    {
        VertexShader = null;
        PixelShader  = compile ps_2_0 PS();
    }
}

Premi Ctrl+S per salvare/compilare il codice. Non dovrebbero comparire errori; nel caso contrario assicurati di aver copiato tutto il codice e che il codice appaia esattamente come nella figura sopra.


Prossimo: Gestire il colore
INDICE: it.Of Effects and Shaders

anonymous user login

Shoutbox

~6d ago

bjoern: Yo peeps! I am looking for a job/project starting July. For contact info check: vvvv specialists available for hire

~1mth ago

joreg: Summer Season 23 vvvv workshops are now ready for sign-up: https://thenodeinstitute.org/vvvv-intermediates-summer-2023/

~1mth ago

schlonzo: yeah! shader input pins now also visible, while the variable it not used!

~1mth ago

benju: Job opportunity, teaching Sounddesign for New Media purposes in Berlin (6hrs/week): https://www.letteverein.berlin/wp-content/uploads/2023/03/Ausschreibung_MIA_LK_6_UStd._Sounddesign_NEU.pdf

~2mth ago

joreg: vvvv gamma 5.0 is out! Please read all about it in the release notes: https://visualprogramming.net/blog/2023/vvvv-gamma-5.0-release

~2mth ago

domj: Coming to LPM next weekend? Learn more about one of the first full vvvv gamma apps, Schéma! https://liveperformersmeeting.net/editions/2023-muenster/program/detail/schema-talk/

~2mth ago

joreg: Want to get started with #vvvv? Check this 12 session beginner online course starting May 8th: https://thenodeinstitute.org/courses/vvvv-beginner-class-summer-2023/

~3mth ago

mediadog: @ggml Yup, lots. Only used in 4.x, haven't tried in 5.x yet: https://www.unrealengine.com/marketplace/en-US/product/simple-udp-tcp-socket-client