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

Tutorial Effects - Preparar el Pixelshader

English | Italian | 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.

TOC: Of Effects and Shaders
Next: Manipulating Colors


Para todos los ejemplos del pixelshader estamos usando la misma configuración básica en el patch con un 2x2 Grid (EX9.Geometry) y un FileTexture (EX9.Texture) conectado al efecto y la View Transform del renderer escalada a 2 (por eso el grid rellena toda la vista):

En vez de utilizar el Template node en el patch siempre lo clonamos como un nuevo efecto como se explica en la página EX9.Effect.Template. Conecta tu recién clonado efecto como se muestra en el patch y abre el CodeEditor haciendo click derecho en el nodo. Copia el códogo de abajo y sustituye el de la plantilla: este es más simple ya que deja quita el VertexShader que no necesitaremos por ahora.

//textura
texture Tex <string uiname="Texture";>;
sampler Samp = sampler_state    //sampler para buscar la textura
{
    Texture   = (Tex);          //aplica la textura al sampler
    MipFilter = LINEAR;         //sampler states
    MinFilter = LINEAR;
    MagFilter = LINEAR;
};
 
//la estructura de la data: "vertexshader to pixelshader"
//usada como data de salida de la función VS
//y como data de entrada en la función 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();
    }
}

Presiona CTRL+S para salvar/compilar el efecto. No se mostrarán errores. Si te sale un error comprueba en el editor que has copiado todo el código (debe aparecer exactamente como arriba).


Next: Manipulating Colors
TOC: Of Effects and Shaders

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 ?