
blin-fong pratibimb model

blin-fong pratibimb model, jise sanshodhit fong pratibimb model bhee kahaa jaataa haye, zim blin dwara fong pratibimb model mein vikasit ack sanshodhan haye.
blin-fong ack chhayankan model haye jiska upayog opengle aur direct3dee kii nishchit-kaary pipeline (direct3dee 10 aur opengle 3.1 seey pahale) mein kiya jaataa haye, aur pratyek sheersh parr kiya jaataa haye kyonki yeh graphics pipeline seey neeche jaataa haye; sheershon key beach pixel moolyon koo adhik computational roop seey mahange fong shading key bajaay default roop seey gaurad shading dwara prakshepit kiya jaataa haye.
varnan.
fong shading mein, ack darshak ("v") aur satah parr paraavartit prakaash-srot ("l") seey kiran key beach bindu utpaad sootra _ 1 kii lagaatar punah ganana karni chaahiye.
yadi, isake bajaay, koee darshak aur prakaash-srot vactor key beach ack "aadhe raaste key vector" kii ganana kartaa haye,
sootra _ 1 koo sootra _ 4 seey badala jaa sakata haye, jahan sootra _ 5 samanya satah haye. uparokt sameekaran mein, sootra _ 6 aur sootra _ 7 donon saamaanyikrit vactor hain, aur sootra _ 8 sameekaran sootra _ 9 kaa samadhan haye jahan sootra _ 10 grihasth matricks haye joe hyperplane mein ack bindu koo darshaata haye jisamen mool hotaa haye aur samanya sootra _ 11 hotaa haye.
yeh bindu utpaad ack konn kii cosine kaa pratinidhitva kartaa haye joe fong key bindu utpaad dwara darshaae gaye konn kaa aadhaa haye yadi "v", "l", "n" aur "r" sabhi ack hii tala mein hain. konon key beach yeh sambandh lagbhag taba bhee sahee rahata haye jaba vactor ack hii tala mein naheen hotey hain, khaskar jaba konn chhote hotey hain. isaliye "aine" aur "aich" key beach key konn koo kabhi-kabhi aadhaa konn kahaa jaataa haye.
yeh dekhate hue kii aadhe raaste key sadish aur satah key samanya key beach kaa konn fong key model mein upayog kiye jaane vaale "r" aur "v" key beach key konn seey chhota honey kii sambhavana haye (jaba taka kii satah koo bahut hii teevra konn seey naheen dekhaa jaataa haye jisake liye yeh badaa honey kii sambhavana haye), aur choonki fong sootra _ 12 kaa upayog curr rhaa haye, isaliye ack ghatank sootra _ 13 koo iss tarah seey nirdhaarit kiya jaa sakata haye kii sootra _ 14 poorv abhivyakti key karib haye.
saamane kii roshni vaali satahon (darshak key saamane kii satahon parr specular reflection) key liye, sootra _ 15 key parinamswarup specular highlites honge joe sambandhit fong reflection seey bahut karib seey mell khaate hain. haalaanki, jabaki fong pratibimb hamesha ack sapaat satah key liye goal hotey hain, jaba satah koo ack seedha konn seey dekhaa jaataa haye tou blin-fong pratibimb andakar hoe jaate hain. isaki tulanaa usa mamle seey kii jaa sakati haye jahaan suraj kshitij key karib samudra mein paraavartit hotaa haye, yaa jahaan ack door kii sadak kii roshni geele footpath mein paraavartit hoti haye, jahaan paraavartan hamesha kshaitij kii tulanaa mein bahut adhik urdhvaadhar roop seey vistaarit hoga.
isake alawa, jabaki ise fong model key ack anuman key roop mein dekhaa jaa sakata haye, yeh kaee prakaar kii satahon key liye fong kii tulanaa mein anubhavjanya roop seey nirdhaarit dwidish paraavartan vitaran karyon key adhik sateek model kaa utpaadan kartaa haye.
dakshata.
blin-fong usa mamle mein fong kii tulanaa mein tej hoga jahaan darshak aur prakaash koo bahut door maanaa jaataa haye, jaise kii nikat yaa anant parr. yeh dishaatmak roshni aur orthographic/isometric camers key liye mamla haye. iss mamle mein, aadhaa maarg sadish sthiti aur satah vakrata seey swatantra haye kyonki aadhaa maarg sadish darshak kii sthiti kii disha aur prakaash kii sthiti kii disha parr nirbhar haye, joe vyaktigat roop seey iss doorasth doori parr abhisaran kartaa haye, isaliye aadhe maarg sadish koo iss mamle mein sthir maanaa jaa sakata haye. isaliye sootra _ 8 kii ganana pratyek prakaash key liye ack baar kii jaa sakati haye aur phir poore frame key liye upayog kiya jaa sakata haye, yaa vaastav mein prakaash aur drishtikon ack hii saapeksh sthiti mein rahate hain. yahee baat reflection vector kaa upayog karane kii fong kii vidhi key saath bhee sach naheen haye joe satah kii vakrata parr nirbhar karati haye aur chhavi key pratyek pixel (yaa vertex lighting key mamle mein model key pratyek vertex key liye) key liye punah ganana kii jaani chaahiye. pariprekshya camers key saath 3dee drishyon mein, yeh anukoolan sambhav naheen haye.
code namoone.
uchch-stariya chhayankan bhasha code namuna.
uchch-stariya chhayankan bhasha mein yeh namuna ack bindu prakaash seey faile aur specular prakaash koo nirdhaarit karane kii ack vidhi haye. prakaash sanrachana, satah key sthaan mein sthiti, drishya disha sadish aur satah key samanya seey gujarate hain. ack prakaash sanrachana vaapas aaa gaee haye;
nakaratmak uttaron key mamle mein neeche diye gaye kuchh bindu utpaadon koo shoonya taka seemit karane kii bhee aavashyakta haye. isake binaa, cameray seey door jaane vaale prakaash koo usee tarah seey maanaa jaataa haye jaise prakaash usaki or jaataa haye. satta ganana key liye, kissy vastu key kinaaron seey door aur cameray seey door prakaash kii ack galat "prabhamandal" utani hii chamkili dikhaai dey sakati haye jitani kii prakaash seedhe cameray kii or pratibimbit hoe rhaa haye.
sanrachana prakaash vyavastha
 float 3 faila;
 float 3 specular;
sanrachana bindu prakaash
 float 3 sthiti;
 float 3 visarjit rung;
 floating diffuse power;
 float 3 specular culler;
 float specular power;
prakaash kii prakaash-bindu (prakaash-bindu, float 3 posses 3 dee, float 3 viewdear, float 3 normal)
 prakaash;
 aggar (prakaash.visaarak shakti> 0)
 float 3 lightdier = light.sthiti-satah key sthaan mein sthiti 3d;// 3d sthiti
 float doori = lambai (prakaash);
 prakaash-kiran = prakaash-kiran/doori;// = samanya (prakaash-kiran);
 doori = doori * doori;// iss rekha koo vyutkram vargamool kaa upayog karke anukoolit kiya jaa sakata haye
 //visarjit prakaash kii teevrata. 0-1 seema key bheetar rakhane key liye santript.
 float endotal = dott (samanya, lightdier);
 float kii teevrata = santript (ndotl);
 //prakaash rung, shakti aur ksheenan mein visarjit prakaash kaarak kii ganana karein
 baahar nickle jaaen.prasaar = teevrata * prakaash.rung-vikshepan * prakaash.visarjit/doori;
 //prakaash sadish aur drishya sadish key beach aadhe sadish kii ganana karein.
 //yeh aamtaur parr vaastavik paraavartan sadish kii ganana karane kii tulanaa mein dheema hotaa haye.
 //saamaanyikrit falan key parasparik vargamool key kaaran
 float 3 aich = samanya (lightdier + viewdear);
 //specular prakaash kii teevrata
 float endoth = dott (samanya, aich);
 teevrata = paav (santript (ndoth), specular hardness);
 //specular light factoring kaa yog karein
 baahar nickle jaaen.specular = teevrata * prakaash.specular culler * light.specular power/doori; 
 vaapas lautein;
opengle shading bhasha code kaa namuna.
openagal shading bhasha mein iss namoone mein dou code faailen, yaa "shaders" hotey hain. pahala ack tathaakathit "vertex shader" haye aur fong shading koo lagu kartaa haye, jiska upayog sheershon key beach satah koo samanya roop seey prakshepit karane key liye kiya jaataa haye. doosara shader ack tathaakathit "fragment shader" haye aur ack bindu prakaash srot seey faile aur specular prakaash koo nirdhaarit karane key liye blin-fong shading model koo lagu kartaa haye.
vertex shader.
yeh vertex shader fong shading lagu kartaa haih
visheshta vee. see. 3 input sthiti;
visheshta vee. see. 3 input samanya;
ack samaan mait4 prakshepan, model drishya, samanya;
alag-alag vee. see. 3 samanya interup;
alag-alag vee. see. 3 vertos;
shoonya mukhya () {
 glaposition = projection * modelview * vc4 (inputposition, 1);
 vc4 vertopose4 = model vyu * vc4 (inputposition, 1);
 vertos = vee. see. 3 (vertos 4)/vertpos4.w;
 samanya interup = vee. see. 3 (samanya * vee. see. 4 (input samanya, 0.0));
tukade kaa shader.
yeh tukada shader blin-fong shading model aur gaama sudhaar koo lagu kartaa haih
sateek madhyasthata float;
vee. see. 3 samanya interup mein;
vee. see. 3 vertos mein;
ack samaan int mode;
sthir vee. see. 3 prakaash-sthaan = vee. see. 3 (1,0,1);
sthir vee. see. 3 prakaash rung = vee. see. 3 (1,0,1);
sthir float prakaash shakti = 40.0;
sthir vee. see. 3 pariveshiya rung = vee. see. 3 (0.1,0,0);
sthir vee. see. 3 visaran = vee. see. 3 (0.5,0,0);
sthir vee. see. 3 speckler = vee. see. 3 (1,0,1);
sthir float shininess = 16.0;
sthir float screengamma = 2.2;// maan leejiye kii monitor koo aiss. aar. jee. bee. rung sthaan mein calibrate kiya gayaa haye
shoonya mukhya () {
 vee. see. 3 samanya = samanya (samanya interup);
 vee. see. 3 lightdier = lightpos-vertos;
 float doori = lambai (prakaash);
 doori = doori * doori;
 lightdier = samanya (lightdier);
 float lambertian = adhikatam (dott (lightdier, samanya), 0.0);
 float specular = 0.0;
 yadi (lambertian> 0.0) {
 vee. see. 3 viewdear = samanya (-wyartpose);
 //yeh blin fong haye
 vee. see. 3 hafdir = samanya (lightdir + viewder);
 float speckangle = adhikatam (dott (aadhaa dier, samanya), 0.0);
 specular = paav (spekangal, shininess);
 //yeh fong haye (tulanaa key liye)
 yadi (mode = = 2) {
 vee. see. 3 paraavartak = paraavartak (-prakaash, samanya);
 spekangal = adhikatam (dott (reflected, viewdear), 0.0);
 //dhyaan dein kii yahaan pratipaadak alag haye
 specular = paav (spekangal, shininess/4.0);
 vee. see. 3 rangeen raikhik = pariveshiya rung +
 defusecler * lambertian * lightcolour * light power/doori +
 speckler * specular * lightcolour * light power/doori;
 //gaama sudhaar lagu karein (parivesh rung, visarjit rung aur vishisht rung maan lein)
 //raikhik kiya gayaa haye, i.ee. unamen koee gaama sudhaar naheen haye)
 vee. see. 3 rung-gamm-sudhaar = paav (rung-rekhiya, vee. see. 3 (1/screengamma));
 //tukade mein gaama sahee rung kaa upayog karein
 gla _ fragcolour = vc4 (colorgamacracted, 1.0);
rung, aur gaama koo thheek naheen kiya jaanaa chaahiye. yadi way gaama-sanshodhit chhavi faailon (jey. pee. ee. jee., pee. aine. jee., aadi) seey praapt rung hain.), unake saath kaam karane seey pahale unhein raikhik banaane kii aavashyakta hoti haye, joe channel moolyon koo seema taka mapkar aur unhein chhavi key gaama moolya taka badhaakar kiya jaataa haye, jise aiss. aar. jee. bee. rung sthaan mein chhaviyon key liye lagbhag 2.2 maanaa jaa sakata haye (bhale hii iss vishisht rung sthaan key liye, ack saral shakti sambandh kewal vaastavik parivartan kaa ack anuman haye). aadhunik graphics epis mein iss gaama sudhaar koo swachaalit roop seey karane kii kshamata hoti haye jaba ack banaavat seey namuna liya jaataa haye yaa ack framebuffer mein likhaa jaataa haye.