From 2c495e06bdbbaa7c981c76ee9afd540bfe235216 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 19 Aug 2012 23:11:02 +0200 Subject: [PATCH] Updated text and added diagram. --- documentation/MaterialBlending.dia | Bin 0 -> 2074 bytes documentation/texturemapping.txt | 8 ++++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 documentation/MaterialBlending.dia diff --git a/documentation/MaterialBlending.dia b/documentation/MaterialBlending.dia new file mode 100644 index 0000000000000000000000000000000000000000..82290f55d9ec4cbda2383df91910342937d0747f GIT binary patch literal 2074 zcmV+#2<7)5iwFP!000023+-LsZ=*&Ke$QWF`Ce1Z&i(){mz>&%st=V~sn_QS+r*)V z!NMdtzw~eKVsK&uHa5#{!`=9llWa|P*k$-;_nY~gPoKXnqtSDauEQk09TUqQkAirX z%)@wbJO2C2uRpot&v#d!=Ar*l{wz{|Ig-B-uk&}eStLRPM@-16#L8Ic0BcGUl(ce6wk+nRcSX% zq9h$X`_b+A!^8G9o|MB(4#qh#_R3!b(=_nE9v|A4FVE{T^eRZJ!!B3JI+P~aW>qse zGEV;go=s`BmPYa7?!(XQLvcyv2XA9FUFcCK+0suJVO;kk*Cr|!0xTB*aj3;XHf1|E6iViqSWkMt=_1;WP@Gu0D*j z-iF`wGko>#Y|;De*A=6o80~0!n7aWF_~q$g@f6O3bxW8X+8i0_u{4{st$Nk&+=VGV zswC^Ji^$&uX*v8aZ)ti|-ry2(M*b`dpLg%})+Cw!6U?%5vVUcMJonT2=%>-2Nwirc z@%U{YB6lI-{C50@eYjxNDarvQ7S>j5mAr-(&N8fzF|w)p6{BU&B!FmXI-{H8OJ- zj%C}7&>QAi)V1?4bp&yEH@8{77%f;_u{m~Ax0}}kyUIS7AKB)f$PLFf8cCcrdCET@ zJ^0Ho+Q|SEU%_J#E*=}NVJ~@G!lU_%QLw@G z1XuHU7=Gu4U>84!+497Z%C^-U$-U?zUIxwgGKim+CGMQ*r7;&?_BcFmFRA)Kyj==4 z0!5$h7UxJGD)f(h}b?5F$5w6qLv6mAQ~n!;i_U0p?aAK0*A~55HrjKY3o=3 z(qcdyY-#A4B0c4>6xwNntqaGp8NVTpMVWLbT%_$WIo4wjv*Q4_=|s8Rj}YDa^umMO zr{^F9W%&>gg%E}6!G|C;L=aML?gZ^11bZL^2to)#CxQ<_=sknb@ABZ;KoSu3wobSv zwobm1Sl+c~c{dC!c`k>p+`ue}#_+53s`-H5ic2Q~rJf>^RX$lzXs%<`JNEBL!O&1MYJ7hT0Zk zgykD6hjpb`&*M64Gixw$&oS{%TTnZHa$5b+b`xkZp%oKkUoU-Jcn?}fFrjrMMP=Ys z>j?U_j?kucgf^`s!OB3_1F`5u?MMvB9Z69f$kmQ4cQ}OV0Kp@%38f=3Qy!Q;A4{yk=u*b5j1NZ3nY>oqC)2g!>AD; z2pLg18UZ2P4(a6#ydGqZU_$1&;|z8(N6;^Ggf^KYw8KxxMEdh2fLPugi=~&Vd zxzKSiv;=na8xc7Y>{=ZBH!zW2WR9R+=2#vEa+Tv?4g&~7Mih?7NDLi>pcjcFXqPya zAjA-a5QI(yAA-;@83~|0$Q!|gym7}!?BtE0U)~69@b}=(ETqP zDR=k?qQ7=f_$X@!0}?Fp&f+89ta5pAq1fl!G|C;z={D??&;!Ocf~+@C@Th>o2eMo=5)*iD+XtV8SiJq zt+Qgl*{)*1g_(*$ZB7j)3@ZkgF`&xL7!J|PfI9Xe1L}BY7*MCJIok2s3^+2N-M9P7 zwRwl>XFv-dh1lBR0}@+fi;(UOe?$1;mVb!6gL3zV@U-&|-W%^A^W|`O2ZSN*yn~0l z!*>8e%8fmab`WyBy`E{;#-3?JqSFzGwcr6VpiH@CO1QciQ0bv$K!t0D0jkH0olfLS#zWS E02C0^Z~y=R literal 0 HcmV?d00001 diff --git a/documentation/texturemapping.txt b/documentation/texturemapping.txt index 9dd25ffd..c4ece7b1 100644 --- a/documentation/texturemapping.txt +++ b/documentation/texturemapping.txt @@ -91,9 +91,13 @@ With a smooth mesh it is possible that each of the three vertices of any given t There are a couple approaches we can adopt to combat this problem. One approach is to attach an alpha value to each vertex so that corners of a triangle can optionally be faded out. If a triangle has the same material value at each vertex then we also give it full alpha at each vertex and the triangle draws normally, but if it has a differnt material for each vertex then we duplicate the triangle three times (once for each material). Each new triangle should then use the same material at each vertex, this material being one of those from the original triangle. The alpha values of the vertices of the new triangles are set such that when the three triangles are drawn on top of each other with additive alpha blending, the desired smoothly shaded triangle results. -One drawback of this approach is that the mesh needs to be drawn with alpha blending enabled, which is both costly and also allows previously drawn geometry to show through. Therefore, before any alpha blended geometry is drawn, you also need to draw the triangle solidly in black. This whole process is rather difficult to explain, but hopefully this diagram of the inputs and outputs makes it clearer: +One drawback of this approach is that the mesh needs to be drawn with alpha blending enabled, which is both costly and also allows previously drawn geometry to show through. Therefore, before any alpha blended geometry is drawn, you also need to draw the triangle solidly in black (which in turn means one of your material identifier need to be reserved as solid black - we use material zero below). This whole process is rather difficult to explain, but hopefully this diagram of the inputs and outputs makes it clearer: -Both of these processes are a lot of work, and add costs such as increasing the amount of geometry being rendered, increasing the size of the vertex data, and adding the cost of alpha blending. However, it can be noted that most of the triangles in a given smooth mesh only use a single material, and so it may well be useful to actually split the input mesh into two parts. The first part would contain only +//Diagram + +//Add kers approach. + +Both of these processes are a lot of work, and add costs such as increasing the amount of geometry being rendered, increasing the size of the vertex data, and adding the cost of alpha blending. However, it can be noted that most of the triangles in a given smooth mesh only use a single material, and so it may well be useful to actually split the input mesh into two parts. The first part would contain only those triangles which use a single material whilst the second prt would contain only those triangles which use two or three materials. This limits the amount of geometry to which we need to apply the complex operations described previously, but on the other hand it increases the batch count as a single mesh is now rendered as two batches instead of one. Storage of textures =================== \ No newline at end of file