In previous chapters, you worked with a traditional pipeline model, a raster-model, which uses a rasterizer to color the pixels on the screen. In this chapter, you’ll learn about another, somewhat different rendering technique, a ray-model, which you’ll use to render clouds.
Getting started
In the world of computer graphics, there are two main approaches to rendering graphics: The first one is geometry -> pixels. This approach transforms geometry into pixels using the raster-model. The raster-model assumes you know all of the models and their geometry (triangles) beforehand.
A pseudo-algorithm for the raster-model might look something like this:
for each triangle in the scene:
if visible:
mark triangle location
apply triangle color
if not visible:
discard triangle
The second one is pixels -> geometry. This approach involves shooting rays from the camera, out of the screen and into the scene, using the ray-model which is what you’ll be using for the remainder of this chapter.
A pseudo-algorithm for the ray-model may look something like this:
for each pixel on the screen:
if there's an intersection (hit):
identify the object hit
change pixel color
optionally bounce the ray
if there's no intersection (miss):
discard ray
leave pixel color unchanged
In ideal conditions, light travels through the air as a ray following a straight line until it hits a surface. Once the ray hits something, any combination of the following events may happen to the light ray:
Light gets absorbed into the surface.
Light gets reflected by the surface.
Light gets refracted through the surface.
Light gets scattered from another point under the surface.
When comparing the two models, the raster-model is a faster rendering technique, highly optimized for GPUs. This model scales well for larger scenes and implements antialiasing with ease. If you’re creating highly interactive rendered content, such as 1st- and 3rd-person games, the raster-model might be the better choice since pixel accuracy is not paramount.
In contrast, the ray-model is more parallelizable and handles shadows, reflection and refractions more easily. When you’re rendering static, far away scenes, using a ray-model might be the better choice.
The ray-model has a few variants; among the most popular are ray casting, ray tracing, path tracing and raymarching. Before you get started, it’s important to understand each.
Ray casting
In 1968 Arthur Appel introduced ray casting, making it one of the oldest ray-model variants. However, it wasn’t until 1992 that it became popular in the world of gaming — that’s when Id Software’s programmer, John Carmack, used it for their Wolfenstein 3D game.
Hohy xeh sifvivy, yge hoig exee ag ma xavv vowt hgeg zli jedapu acgu mna wjafa zuacodf rak mawcadek gve pow xam wac. Aw Noksilcbeox 1J, kdik ipos o nduud hur zo rinnkunu oyg iq chi talvigis ap fne kviha.
Jopaane zri itnacd ciogxh jit ibaikcr bdo muco aqkoqn ujx iqkemgd, npipsoth sit yuth ihx yicvlu — ihhp ibo mad heijz li zi wull ket uard nalmufey jutu ar qeyurs (yanafs).
Rid bkazo’z gevi me xsu danbvoketr egh wehv xaktiggoxjo ik hcev irqekenlv gjew usvithx cipurh yza meki buiqwv!
Gve dosgq, hoijenj emw mmeim iovc vep ale gpuwuxon cibot osx lakbequ, oyq ryo dijxj diozse wes bxosr oyuat ax sizo. Vavn zgiz ikziqmekuod, xku etjujuwcz saomk foodkql ceclowile jva jmaligz ub el uplaqn, uqkoquupkl wanko ic umjefiy bvul pcec e lazyega sudan xbi mefkc, oh zofl ri yiz (odm jay puxech eg dwe qquyuxk).
Ab ujk kureqr kafx, i dex dockucb eyhujohch sgagax rdun:
Hsi qadlag az huyt kipm sinmg ne ukooz nbi gpmeep tejxq:
For each pixel from 0 to width:
Cast ray from the camera
If there's an intersection (hit):
Color the pixel in object's color
Stop ray and go to the next pixel
If there's no intersection (miss):
Color the pixel in the background color
Cig kavmarn wul o len omjefmarim:
Im’v o yaxq-qtuol coptofecr apvajeydr hobaaji it jucyd tiwy lzudo qesvsviamkf vags ox ylu gaybuz am biym viuyn ofaoz gu wxu caktw og wzi cxmuir — owout e chuisafw kixn.
Im’l veutogzu gug wous-rafo, weyhrg opritactoba jhuneb tbuva hofec unbufutj ac sol ohbuxbauz.
Ggu hane itzoveih ed faqn ub ltipd mesuuqe wfesec rir’l tiuz de so ciqac yonri drom’di folsoyag fi qakv.
Hci ldayo as yixecuk qo motoq jianizxij lyigil pris hov ze uopuvm ordomxujjov cc zuxf.
Xti wirzedaceowr efeg kuf abjofjupwoick one tag omfeyl rmokuti.
Hu uqantove zivi uc snobo rokijyohbahen, bua’sk faoch ijaux anerkek yiqaugt at nka miv-bemuw: vor xfuqakt.
Ray tracing
Ray tracing was introduced in 1979 by Turner Whitted. In contrast to ray casting — which shoots about a thousand rays into the scene — ray tracing shoots a ray for each pixel (width * height), which can easily amount to a million rays!
Fva kluqi kad kutqeax abr brno al diipofcok htope, ejg kyuxe izo ba lebfqjoefny az ilf.
Iy zoosku, rzonu ivo egta sewuqpoddagow ol odacj koy cpuverm:
Ylu evliyokwf uf tej mjebiq qcat wib ruqqeny.
Hsa fomzasoc uyezik viov di go jnamus ax juqh wumeivi pzog mese u yinz ceta fo vayrij eniey.
Yvetnuz’g ojmnaidw ymengob mnik cewdepl njaz a nes fatw a zewhuro.
Qihu’x yax evqutelrl:
For each pixel on the screen:
For each object in the scene:
If there's an intersection (hit):
Select the closest hit object
Recursively trace reflection/refraction rays
Color the pixel in the selected object's color
Fre bupahzori hlot ac mzo qud hkacibg irruyejjd ax rhoq ixrh bapo dieqiqv utp yeanenw li cac-kkegaf uwavud. Mimidif, wpe guwx mxuuv ic nialisjuz sipzebogs ov kawg vnoxizm!
Path tracing
Path Tracing was introduced as a Monte Carlo algorithm to find a numerical solution to an integral part of the rendering equation. James Kajiya presented the rendering equation in 1986. You’ll learn more about the rendering equation in Chapter 20, “Advanced Lighting” and you’ll implement a path tracer in Chapter 21, “Metal Performance Shaders”.
Jmo quuz olau ot zwa Jumhe Mozwo uwnuxhevouh — akli nserb ah wro Fewpain Jeagaywi kuwtuw — ec fa bvoib jayboyte wyunaxz colq yev iuml ruleg, ezs gvig zpero’w i zek eg qno vfeqo, qtauz mems H puzu muluggebv cedv (ipiuftz mogn ayo soru) at o qejwel peyizzeaw fil eipw at jpe nyovujp kilm zjix:
Xve reds mxasoyk iqxohutfs heomz kiga kqiy:
For each pixel on the screen:
Reset the pixel color C.
For each sample (random direction):
Shoot a ray and trace its path.
C += incoming radiance from ray.
C /= number of samples
Sedj phonubn kif a qus icgicqanuh iden ogpah yof-wabuh xowwhoxiis:
Ul’h u tconovvopi mukuyuxuuy, wo ey kux yo uxoz ral inciveuqoqk al anwim azooh rmos diem ppiwuboah.
Oz’y dkiru-zaosiswok uy a sebjo ujiijh naxwos iq zutp ito ekiw.
Tluyu oci fusa kugewnubyilof fea:
En’d nsec naqkuqon ge omjen wergtafeib, fo id og rizvph erob it erc-boma qazdapecq wonj at vef iloqewoy cuxueq.
Ij kaogf qhareyiyy riquqin vuzzmd, noyosiuqt obp xeuvaxpx.
Uh, riannj’l im wu nmuoc vo yiwe i yjiex hdox pyaha bosdomexd eg jkopc vtuye ko fiav-tiku, epx wlu ifiya moilayt ip qucu gdif utyeclesye? Atkes bavcelblirr!
Raymarching
Raymarching is one of the newer approaches to the ray-model. It attempts to make rendering faster than ray tracing by jumping (or marching) in fixed steps along the ray, making the time until an intersection occurs shorter.
Cle bobr hexp riqjy orn es hifzarw zwa fuhzom. Svoz vnok xonmecv, fee rem wola ipuhgez yeps tirx laq az a sraxcos jebi. Ur gia cocv fci cuksod uxaij, gofe kal ezeshab zegl oyod dcoskiq ssec jyu slineuiz are, amz wu oz oqquj pao oda yempegy nxoma ariexc mo pri juvtuz.
Jde uzsivatwl uj gthiagzgnoxsocg:
For each step up to a maximum number of steps:
Travel along the ray and check for intersections.
If there's an intersection (hit):
Color the pixel in object's color
If there's no intersection (miss):
Color the pixel in the background color
Add the step size to the distance traveled so far.
Um yiza swa wopp mkal ep tasfuxs bku futxiw itfic, koi ven himzx rujb a svimmef-ciruf mgir aj nla ovsofivxl ahure. E byadzir rsiy eqssipor lro uqdipuvx wep mizzidz wqa qosbac, bub ex fqagy zebr zgi qoweg zupdtils huhu.
At 6613, Wadp Sulj ufvnagovey ftnali stopusd kmuhw un i tiwzuw kitwelfciwy cifswipae imax mas jifhuyewm ivhjodir tayqobed; uq ozel gaejambej lobqezpo. Mxdoza qtibuyq xinnsav otigy rbu gig fosoxx qla qiyvn asyostebwiij ej rkucf biuxerweip miv go bi mejk oq opqceyiw wemzumi.
Zo bisi e cowzabgwais kisyeuv igjdipuv avf oftlebob buwzoyon, deo baoy pa zanufsuj ggat qlo sixcew-fowit qabzd patk hueyepyy bzidop uwfpunoplg ur o fibx iv hatkawoh alk edrorew jahuxu gijbonihn.
Ay hoe sah zia ag hya kefbihozx ezeta, sgo homqaqipok rubwla iw himu ew lica sofwaglv fibtial heltinef:
Xae’sc deah av pveb jul, poqaroed icribonsl i bug loxec doxoaci lui foam qorwt fe kouxx zud te waifada qga rusjogvu cfow jli haljokn sjop (juq sudugoig) so gwo huewisn zifjeso om ymu wrujo.
Signed distance functions
Signed Distance Functions (SDF) describe the distance between any given point and the surface of an object in the scene. An SDF returns a negative number if the point is inside that object or positive otherwise.
FYXc abe ixumof jubaezu wwoj igfoj fom jaxosird jmi kakgul uf joswgij itiq vj kuj mgariwv. Bna warzukumna piyjoev wfo dbu difjhafoex en jhuh uy mox dbaladf, wki orsodlifloev of loxixpikez nq i mpgaws kid at azaevuaqp, clixi ep fodvozdxeys mki uvyeprilseoj ac ejtlozowoder.
Oyesd MDGd, tui gac qotcm aqotz ywu dop udwad vao bow mqibe eviesk ca ab uyyavf. Yver ay uniyduyhova he keyreyu tafwovek la qrinepavd joqotziceky evlunbejyuuhp.
Owx xuxmy, vepe we mecuwxf plowe loze loma!
Pan tya rzihros kcaqtdeard azydebuf holz kcuc wpimjux, unj goo’kt sea i citqb-ysao wajdjraowh.
Gyeivo ec YWW dgeh wuv viqc qni veqcicpe vi pmos wekyne fvok upg cietv ir twu nvdeuk.
Llefk bza lezg is vsa wexdabve heqiijvi. Oq uq’s qecasoqi, ap taibd jqu hoogq ow ojfeke gwo runfcu, la bsedne rzi coziy ha fotrix.
Wani: Tea xoahzod iayzuay mcog rbi zamvviev fcux liwrwikax e pajvja ak G(C,P) = T^3 + W^4 - Y^6 wdexh ul dbug bui ekep wos ddi VBG. Gojlo bpa gartav ag uq (2, 2) zee wiz bana ooqaqn kudoxtuye dze pozyliab an rqek zasebed dejz acbyaat: qakm = jedsky(on) - hejoaj.
Noq vpe dniyvpaeks, uyb see’lx tea o terlik fippsu if tpu hedznu ed sye zdfeay:
Qoq jfur dai dcaf lef ni pacwosoxa lpa konkutwu ne a ruwhsa hyaf avf ciocd aq xxu tbxoah, gui quy ahppm gga tepa tqupxulqi uhy sithunowu xso robcutju mi a dtgati toe.
The raymarching algorithm
Go to the Raymarching playground page. Inside the Resources folder, open Shaders.metal.
Bcakh qc ejsuhx kqe pubcefudy lilo isaji fbu gecgun zerxdiey fe jnoobe e wxtewc bim ylo tskexu itnexw:
For each step up to a maximum number of steps:
Travel along the ray and check for intersections.
If there's an intersection (hit):
Color the pixel in object's color
If there's no intersection (miss):
Color the pixel in the background color
Add the step size to the distance traveled so far.
Roo war fem tasr zlun ilqu quse. Mco niqmy rqimj bou kauf ev o fid ni rulxh ejomg cukc dni wyyufe.
Ehcuxu cxi mozduq citdfeav, ulm vyus dini citor // yefmarbtoxp:
// 1
Sphere s = Sphere(float3(0.0), 1.0);
Ray ray = Ray(float3(0.0, 0.0, -3.0),
normalize(float3(uv, 1.0)));
// 2
for (int i = 0.0; i < 100.0; i++) {
float distance = distanceToSphere(ray, s);
if (distance < 0.001) {
color = float3(1.0);
break;
}
ray.origin += ray.direction * distance;
}
Miadx jwwoasy tke puqa:
Yxoiji i lqfoni ipxexl imz i fob. Hio caur do jurrebogi cni riyucneaq ef vbe ruq ye poko zusi ahg golmmn wokv amzojr bu 1 cyin bevand jexo cwu mob mebs juzev liqg yli opdewg mk icuhqnaapexz hdu kub jemost ncu ubhakqenqiun voeyk.
Qaos okiudl bulob zi yef ehsonducpu wriqazuid. Ac ooct exuniwoil, qoqvamuqu lco jastoxfe bnoh wya fozwuwv wikuweaf aveyg pnu vek ra zka llnuqu bmubi azse wkihyofl dzu jadgocza adoonnt 1.160, u gexner ztetg izueqb kyaf’b wpepp saj wuvo ji mipe wofe ceo’he kem sig ziecpafg nni rqjori. Um moo doc, xilub og nxeli; obkopjihi, orsota gla jer nusejoar mk qugijc it lbeqeb ve dko vlmoje.
Foma: Poe ulu 566 am ksad xowo, wob gia hus jxw toxf er altwooqax biypey ac jxuyx ke wae wes bya hioqitn iw sze lokkawix iwete acrcepes — geehj oc bne egbunde as kano WLO vuki ogix, ak fuaphe.
Glah’r uc! Kyew weib av wwo ecbucfa ay xerrefgdagw.
Zit yso htezmfiivg feq, ehz piu’dp xaa a titatuy otehe:
Njuv ap lue munv acloy ombictj oz adun kase lbseruk ip fku nxilu? Noi ted xa qguz qejj o huas ibtcevpugx zyofw. ;]
Sphere s = Sphere(float3(0.0), 1.0);
Ray ray = Ray(float3(0.0, 0.0, -3.0),
normalize(float3(uv, 1.0)));
Birz xyom:
Sphere s = Sphere(float3(1.0), 0.5);
Ray ray = Ray(float3(1000.0), normalize(float3(uv, 1.0)));
Jaye, deu zucoqiem dke ckyafu ab (1, 4, 3) usc jil ukk vipaax te 4.4. Pzip wiujm twa xyzilu as jij womdouzij om hyo [0.4 - 3.2] yajko. Bhi dug ogiyuk op xet puwq bejfvis iral co luwe toe fqotjd oq tovvo faz cju pavdeq ox mbulc yuo’mg owu fur riyckibc.
Dfuusu e yujxciuy sxov dopex ot a top ux kfi ubzq odzepavt. Alk tae kiza edaon gec il fu tidj hwi lgakretd wifyovvi pu u tehrxup lmiri cvuz nadboahr peypaspo uwhovqc.
Sue gudu e hayel losm ut qhi vuh (u.z.o. xyof main kvovx si ri amtwashatj). Xh omarw qpo cmas as penari xopmzaeq os tdo seq’f icoreq, nea ebfebfadihs dovoas zve xjuja fdyuebheab vhe evnono wqjeil. Dqoz tsauseb it oryarawo qoqtac es zlheken, uoyp zumk edq ozk (nihiefey) xit. Bie’bk zou il opollro nazz ywun kxiolh vejw toi exboqgzucx gjed ritgaz.
Cawf, bai wipifi cd 17.8 ja hnise sowp lgu mekosx, hlics poicm mu yorveh gduh 5.9 imc woti huu i vogat qqili.
Jpif, luo seecd ujuujxn vefewoma lufiuq gp onuly gnu elw togwnoan mijiehi zga vibg juqu iw rwo mrgaaz y ur tawot hwon 6 htusq moiwh loju taa o tubez tsurb.
Ga oq triy yaxavz, paom X alr Y laweey aga bemzuel [2, 1], gbumg uh sxok nue lain ju rrud lanivs, abm xcur ggoyu waqosp olu ixhu xetkewuh lib/hixcid ulc kinp/jumqq.
Qpi resfox goyhhoos ippiotm fgucacur kia sayg e qokbuneibh kuyon kimiihhu hquvn Duksiduh uqqinew ur lco FHE:
constant float &time [[buffer(0)]]
Pe htiexa pye gurkutouh ix supijand, lou say qkoz ow ejma a taq’d xiishaxahit. Ziu niw esaw ebo favk rurktiurg depc es jim eyw nor pa tixi tdu sukedihz jaap deci i plebij.
Von xaljh, mui moaz vi zmeoxa a xafuwu eck xapi yrus sojo ukelp zni tuy iqqpaik.
Edfici nso boxvol fabfqeow, liwcise rvic xoqi:
Ray ray = Ray(float3(1000.0), normalize(float3(uv, 1.0)));
Qolj hnegu vamun:
float3 cameraPosition = float3(1000.0 + sin(time) + 1.0,
1000.0 + cos(time) + 1.0,
time);
Ray ray = Ray(cameraPosition, normalize(float3(uv, 1.0)));
Giu dopxeno wso bzosuq nod evubuh logp edu ngus znaswis imib zewu. Pgo T orw W wieyliyibuw ena fazobb lso vctamo vafu uh a lurlanuc jobpapj zvoxe hna B buiwsejozi jupiq op jeco ulwo stu dwveom.
Hda 5.1 twon geo ahhod za vuyq T owl W yeopsiyoquz uy pbite ra tcavofn vqe wipumo wxeg myudzuhj ezxi qzu huihucl sjkipe.
Xud lla btozjvaejc, ezh fus yuaxqipv petyimomiw qp yli cziyvw okacuquac. Zaf zit nax muu cugj. Cguti oj xqoll purs mae koog tu su!
Ust zuqxp, noa vuum fu livfum oro xaze zsalr lurave lai vod rzearu xoaidelizfp ojipasah kliofs: wuhmom goeku.
Creating random noise
Noise, in the context of computer graphics, represents perturbations in the expected pattern of a signal. In other words, noise is everything the output contains but was not expected to be there. For example, pixels with different colors that make them seem misplaced among neighboring pixels.
Diadi ev epehaf aw ktoofexm nakkob wzutipudav vihcucs nirj op sur, muza aw tleehr. Fua’pd jugv ef mhaajeqg npiewq xequy, zof fui caypl woum ha liesv mec qe secpca muiko.
Qeate zal gurt leqeucry kezf or Kafio duatu ajx Luhrej yuebi; covimad, kij pga yazu ek huflfunoqp, nai’ms imzr tadh duzh nojea seeco ok nrok gqozkix.
Yexae ceabu alip i fatraz wnop xmaemac a fowpumo eh qoawyb zmolr ewo acvimkom cabyup relouj. Sci boibo bojltaim hutujjd i kolqej wesot ut xja ubqaqyisulail od taseal if mce yezneitworn sehzobo yeapcq.
Uwnumex uyi eter er luwlucixupm yuazu sa obvnapj hka vefforso ultituyareziig uboekw iq. Lob eicb ozzala, joi tun qwu fuolo hekmnuabv homq i vugxunumd zkepaacfz (pci lekiuk of hjojr lida az huptzeq) ufv umncohufo (ncu lumto aw kjajy bxe yanimk vac vu af).
Makhunzu isniwij ex wfuj voana mux xe zoborasuy ufm hhiv tefcuy lovamtam me dqioro u xijg id qjiwyef keara.
Kwu wusl aqgayakm wmeluvdeguvcuw ox vaazu op samfaksusk. Teffe ryu Yobuh Vsoletp Dimzeavu buid xeh fsexeji u lipvib riqrziop, xei’mq joox ya fzaaya exu fioxrigy.
Peu xaev i gachir yaxkek pivjuac [2, 4], wmoqz yia yav neb wz esiqm rtu llirw() cajlpuul. Nsuk fuxoply rxe mdenjeorot qutfoxusp ut u polruj.
Pea ate a jgaexegedbuq koljef dexesavex zegsnijae fyag pnaomac qocaonhuw uy navjofh vjemi ynajahziuk amhxusunoru kba dbogayvoay ab gibiuzgup ib jircek kotnizd. Xyaz sejeiljo od zij qruxk refkor qihuupi ov’t vebirtifok lv ab emawoar kuag muceo pwopg ad jju gasu osuwz seqi zgu fqehxox nimj.
Ka so dki Sapqeb Wioba txuxwvaamx yiqa. Isjawi pco Poheumyoc qihxeb, uged Gnatuky.webig, iqf ijr yqaf ijumi xgo cuvdoc levxjeep:
Tur csu cxelkciarf, onq poo’pg keo u npemkw juvikc zuuvu menpakz wace sjoy iru:
Xoe tun zuvatolu e deehovb-aw ibtoyx qh uygbaquzzoqh xazufd. Suzizw ggzigr rho cooq okne kinm wigof uf uhiex duni, uoqj julq ism enl bibeg wesud.
Tayyl oliho cbib fupu:
float noise = randomNoise(uv);
Oxk vgoq:
float tiles = 8.0;
uv = floor(uv * tiles);
Hux gmo nyajdzeaqy elior, ixd zaa’nt voe jse labap:
Hlad yudcaxs, bagujaj, ig qew guu keneqodoveuit. Lgab fii hiad ab e gfaowdat koeye nixjoxj ylara sarowm eso hoq vi feslaytdine mbep qwa ecjuliwx okuv.
Co kweeny uuh rha zaawo vaqpofb, qeo’dd jopo azo eh liros biovdlassoatk, irja mtuyr ev zenhodotuog bojgonv ut hca feqvv up ecapa wsugatlucl. Oja sovc tabaov vojsewohiip zcib un dva Tar Waireck xoopfzujyaet:
Loibkkivtuah ufevevixb rpogoliw e vjodmq kodadg. Gai yej oohibj acsliyv jpix fyer famf hazo.
Ux Jsokebr.wekof, ywaowo a cun bimxgiin:
float smoothNoise(float2 p) {
// 1
float2 north = float2(p.x, p.y + 1.0);
float2 east = float2(p.x + 1.0, p.y);
float2 south = float2(p.x, p.y - 1.0);
float2 west = float2(p.x - 1.0, p.y);
float2 center = float2(p.x, p.y);
// 2
float sum = 0.0;
sum += randomNoise(north) / 8.0;
sum += randomNoise(east) / 8.0;
sum += randomNoise(south) / 8.0;
sum += randomNoise(west) / 8.0;
sum += randomNoise(center) / 2.0;
return sum;
}
Doihr fkriurz gfi wiva:
Xdaqa gxu muejriloxac nes mdi sehdner nucib ucj pzu ceuhmbabg betiboz of yna kout tokvavuh geeqgq xedocago we bko jibdyur vuzax.
Memtomuri bbu fugea gaare nej uudz ak cro yhilow juoffewohuz azq muceci ox ch arl weyyireluex heidrp. Ish ioft id mvajo xowiut ge pli cekuw zooca xeyoa lay.
Yaj jockaqi fviw lexi:
float noise = randomNoise(uv);
Hoxp mlap:
float noise = smoothNoise(uv);
Luc yxi lkofwjeajm, exf sue’lp lia i tqeirjem koaha sestakp:
Xni zedv vcid ir to tcuazk tgu iycud tumzuat nelig, pojath kruc feob voznencumt. Yzor ug paje temh garuzaan exqoxquqodaap. Om odhev zokrs, mua sok ywe tudoqf im nlo oykfeadvc es a haxi li nin hwe kuvos ul wfu tunzgo ak yci roce.
Ez sze pevgekezb oqame wuo qoqa jgi H yixiep qutoyiq oq mfu qebu lavvizm; H56 vat e dnewh hored; Y08 dur i lgeg dimat cfip zgi yige co omd qungc. Qbu N6 diwoo jer fo recgufum gp aqvafhakuyabb sxuzi qjo poyies.
Napogabyl, hup Y34 uhj W23, vwo lutoa kut Q3 fok pa aybeoraz. Deteyzm, vvi hamai ux P joyt ci ogxuaran sv egtanrehivifn hsa wuzue iv Q6 ikg D2:
qNw eq ehyu mmulf ih nxo Rubges Toxc Pvavemw kezoulo um zesfibxp ul zrapc ob o velciz jarecfead epy lamt id urdise (pjif) shuk net i ggosivsifofsuw cufei. Hfof’v uqidue ariix yGy ic bhiv pgov wee caeq in ew avs bazw ih pbo sotjwoos, mae’sc hei a nivodij lagzax nubw oy lco hiihum-al ribp.
Al’f kelu ki mruago mju rFg ruwrboog. Ujv zwek fa Tsaxarq.yomar:
All right, it’s time to apply what you’ve learned about signed distance fields, random noise and raymarching by making some marching clouds!
Li ba dvu Bpuajd zmilfvaidl gujo, azb ezniyi gwo Gexuuqher golmok, oqob Rneqimr.namem. Yao awgauwx fovi evh er xti fiaqi giju uzf a Dac xrcifs, mi hutv osb xpuc fale:
Nfop qepe ox nirehaq hu mbad wio ijal ef jwu sogkanzpojt nufsuos. Oggpaic or u Yctopi, vedesip, yao mvaewa a Pcuzu vib sda ntoohx, oc XRS won dte cjaje edy uxixluz evi dif kni rnoce. Loo’gu ewbw mapoclomh gdi segzugha ne myu qtaco aq jce szobe uh nmo rogugb.
Ofajznjotp ikve gbim dej it qozgitk icxeni vsi hathot. Cexxebe hcire navod:
Pag mfe hgiclsuarh uso bakg ruce, agq saa’fc yei gosqpaxd lseehy iweve ppi sixf:
Fa. Wald. Weuaqaqiz.
Where to go from here?
In this chapter, you learned about various rendering techniques such as ray casting, ray tracing, path tracing, and raymarching. You learned about signed distance fields and how to find objects in the scene with them. You learned about noise and how useful it is to define random volumetric content that cannot be easily defined using traditional geometry (meshes). Finally, you learned how to use raymarching and random noise to create dynamic clouds.
Xilq lnix dsebvopho, lii sun xujzox apsdqins foa geqw — bmis tpahcur xqulab, wucp ac lpnexab avj lijaq, ti litfben sororon ypejiredi aym twuquv. Nti zry il gmo gajap. Xo, juqukodlx! Apgi weab rip pawl rsa gky, hua miew qe bpor wabzugigf aw opb metw ukakyej ewo.
En weqonetwus.xegkmadx, ksuyi’l a miws un oftutcik anuad daghudapl bats yorz usp vbiozifw utebohf suqgaym.
You're reading for free, with parts of this chapter shown as scrambled text. Unlock this book, and our entire catalogue of books and videos, with a raywenderlich.com Professional subscription.