» 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

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

~9h ago

Urbankind: circuitb:Wrongcop is epic! :)

~10h ago

joreg: @tobi: use GetSlice() as the patch i referred you to is demonstrating. or start a forum thread with your patch.

~10h ago

TobiTobsen123: hmm yes i can see the values...but how to handle them as seperate values? I need to forward them via TCP/IP...

~11h ago

joreg: @tobi: OSCDecoder helppatch has a section: OSC_Advanced (bottomright) that demoes decoding of multiple messages

~12h ago

TobiTobsen123: I'm using an OSCDecoder, it receives two arguments...works but how can I seperate the arguments into two seperate values

~14h ago

u7angel: @mediadog, make it a forum question.

~14h ago

u7angel: @mediadog, tty renderer ?

~17h ago

microdee: however non-conductive objects are invisible for this so the pencil and the sticks in the video are still a mysteries