detect even or odd coordinates, ebook

[ Pobierz całość w formacie PDF ]
// (C) 2011 Jan-Willem Krans (janwillem32 <at> hotmail.com)// This file is part of Video pixel shader pack.// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.// detect even or odd coordinates// This shader can be run as a screen space pixel shader.// If possible, avoid compiling with the software emulation modes (ps_?_sw). Pixel shaders require a lot of processing power to run in real-time software mode.// This shader will draw a grid of pixels, with colors depending on even or odd horizontal and vertical coordinates.float2 c0;float4 main(float2 tex : TEXCOORD0) : COLOR{float2 n = frac(tex*c0/2.);n.x = (n.x > .5)? 1 : -1;// even x positive, odd x negativen.y = (n.y > .5)? 1 : -1;// even y positive, odd y negativeif(n.x == -1) {if(n.y == -1) return float4(0, 0, 0, 1);// odd x and odd y, black outputif(n.y == 1) return float4(0, 0, 1, 1);// odd x and even y, blue outputreturn float4(1, 0, 1, 1);}// error, magenta outputif(n.x == 1) {if(n.y == -1) return float4(0, 1, 1, 1);// even x and odd y, cyan outputif(n.y == 1) return float4(0, 1, 0, 1);// even x and even y, green outputreturn float4(1, 1, 0, 1);}// error, yellow outputif(n.y == 1) return 1;// error, white outputreturn float4(1, 0, 0, 1);// error, red output} [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • cocksparrer.xlx.pl
  • Strona Główna
  • ebook Odpowiedzi na pytania ksiegowych, ksiegowosc pytania odpowiedzi
  • ebook-psychologia-osiagniec, Książki MLM, Ksiazki MLM, Książki MLM
  • ebook-google-adwords, ebooks, ebooks komputerowe, Google
  • efachowiec 3-2010, eBOOK, CZASOPISMA BUDOWLANE, eFachowiec, 2010
  • eBook.PL.Lowmianski Henryk Prusy-Litwa-Krzyzacy.- mauka.historta.książka.książki, ►►► Zakon Krzyzacki, ♣ Literatura
  • eBook - Martial Arts - Fitness Training, fitness
  • ebook O'Reilly Java Servlet Programming, java
  • ebook digital photography proffesional techniques, Fotografia, Fotografia 1
  • eBook - Martial Arts - Fitness Training, Wasze Pliczki, e-booki, ćwiczenia fizyczne, fitness
  • eBook dlaczego postanowilem czekac, czystosc, Wszystko o czystoÅ›ci, czyli jak utrzymać piÄ™kno swojej duszy
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • cukrzycowo.xlx.pl