» チュートリアル エフェクト - ピクセルシェーダーの準備
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

~27d ago

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

~30d 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

~1mth 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

~3mth ago

ggml: someone has sent udp bytes to unreal ?