» 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

~6d ago

fleg: This Tuesday, Cologne: exhibition opening of "interwoven", textile disinformation patterns created with vvvv. https://fleg.de/news/exhibition-interwoven

~19d ago

manuelgonzalvez: Assimp nodes all broken afted Win Update w/exception "COM object that has been separated from its underlying RCW(...)"

~19d ago

manuelgonzalvez: @levi thanks would love to! anyway managed to get something similar working based on forum search and anthokio's patches.

~20d ago

levi: @ravasquez thanks. 31.2 x86 verrion worked. @manuelgonzalvez i have a dx11 projectTexture if u a want.

~21d ago

manuelgonzalvez: Anyone has a dx11 port of "projectedTexture" dx9 fx for projection mapping?

~21d ago

manuelgonzalvez: Anyone has a dx11 port of "projectedTexture" dx9 fx for projection mapping?

~21d ago

ravazquez: @levi not sure bout the ImagePack, but I believe VL.OpenCV should give you the same tools and should work with beta just fine

~22d ago

levi: anyone knows of a VVVVpacks.image that works for elliot's projector calibration patches?x64,dx11. always crashes v4 on solve.

~29d ago

Lorenz: VJing with GIFS: https://lorenzpotthast.de/gifjockey/ A fun little side project, that I first prototyped in v4 and now turned web-based ;)

~2mth ago

schlonzo: finally fixed in 4.8 nice1