» 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

~2d ago

joreg: Workshop on 09 05: Deepdive into the Stride 3D Engine. Signup here: https://thenodeinstitute.org/courses/ss24-vvvv-advanced-3d-rendering-in-vvvv-with-stride/

~2d ago

tekcor: Dear vvvv community, I am leaving my personal fundraiser here because I know many of you personally, sending love https://t.ly/iV9l_

~3d ago

joreg: Rewatch the 24th vvvvorldwide meetup here: https://www.youtube.com/live/gNszIiRAjDo?si=0RXF0pW73EUaRqGk

~3d ago

joreg: LINK - the vvvv summer camp 2024 is announced: https://visualprogramming.net/blog/2024/link-the-vvvv-summer-camp-24/

~5d ago

joreg: Tonight, May 3, vvvv meetup in Berlin or via stream: https://visualprogramming.net/blog/2024/24.-vvvv-worldwide-meetup/

~8d ago

joreg: Workshop on 02 05: Intro to the Stride 3D Engine. Signup here: https://thenodeinstitute.org/courses/ss24-vvvv-intro-to-the-stride-3d-engine-in-vvvv/

~9d ago

joreg: The new vvvv Show-Off-Reel is out: https://vimeo.com/930568091

~15d ago

joreg: The summer season of vvvv workshops at The NODE Institute is out: https://thenodeinstitute.org/ss24-vvvv-intermediates/