» チュートリアル エフェクト - ピクセルシェーダーの準備
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

チュートリアル エフェクト - ピクセルシェーダーの準備

English | Italian | Spanish | Mandarin | French

TOC: エフェクトとシェーダー
Next: 色操作


全てのピクセルシェーダーの例で私たちは同様に基本的なパッチを使い、それらは2x2のGrid (EX9.Geometry)FileTexture (EX9.Texture)をエフェクトに接続し、RendererのView Transformはグリッドが全部の視界を満たすように2倍にスケールされるように設定します:

パッチのTemplateノードの代わりに、私たちはいつもeffectsページで記載されているように新しいエフェクトをクローンします。パッチの中で示すように新しいクローンされたエフェクトを接続して、ノード上で右クリックしてコードエディターを開いてください。それから、以下のコードを理解して、それをテンプレートコードと置き換えましょう。このコードは、私たちに今は必要ない頂点シェーダー部分が排除されてよりいっそう簡単なものになっています。

//texture
texture Tex <string uiname="Texture";>;
sampler Samp = sampler_state    //sampler for doing the texture-lookup
{
    Texture   = (Tex);          //apply a texture to the sampler
    MipFilter = LINEAR;         //sampler states
    MinFilter = LINEAR;
    MagFilter = LINEAR;
};
 
//the data structure: "vertexshader to pixelshader"
//used as output data with the VS function
//and as input data with the PS function
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();
    }
}

CTRL+Sを押してコードを保存/コンパイルしてください。エラーは表示されないはずです。もしエラーがあったら、間違いなく全てがコピーされているか確認してエディター上のコードが上の図のようになっているか確かめてください。


Next: 色操作
TOC: エフェクトとシェーダー

anonymous user login

Shoutbox

~15d ago

~18d ago

joreg: The Winter Season of vvvv workshops is now over but all recordings are still available for purchase: https://thenodeinstitute.org/ws23-vvvv-intermediates/

~24d ago

schlonzo: Love the new drag and drop functionality for links in latest previews!

~1mth ago

joreg: Workshop on 29 02: Create Sequencers and Precise Clock Based Tools. Signup here: https://thenodeinstitute.org/courses/ws23-vvvv-08-create-sequencers-and-precise-clock-based-tools-in-vvvv-gamma/

~1mth ago

joreg: Workshop on 22 02: Unlocking Shader Artistry: A Journey through ‘The Book of Shaders’ with FUSE. Signup here: https://thenodeinstitute.org/courses/ws23-vvvv-12-book-of-shaders/

~2mth ago

joreg: Talk and Workshop on February 15 & 16 in Frankfurt: https://visualprogramming.net/blog/vvvv-at-node-code-frankfurt/

~2mth ago

woei: @Joanie_AntiVJ: think so, looks doable