T.G.Jay's profileJay in Tiny GlobePhotosBlogListsMore Tools Help

T.G.Jay

Occupation
Photo 1 of 9
感谢访问 www.tgjay.com
Please wait...
Sorry, the comment you entered is too long. Please shorten it.
You didn't enter anything. Please try again.
Sorry, we can't add your comment right now. Please try again later.
To add a comment, you need permission from your parent. Ask for permission
Your parent has turned off comments.
Sorry, we can't delete your comment right now. Please try again later.
You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
Complete the security check below to finish leaving your comment.
The characters you type in the security check must match the characters in the picture or audio.
Sept. 7
A梦 多拉wrote:
 Your blog is very good, very much like your blog in the article. And you want to become friends 南京货架公司是国内知名仓库货架 ,仓储笼制造商,生产仓储笼,销售仓储笼折叠式仓储笼服务、仓储笼配送、以及托盘钢托盘服务。最近有很多客户主动联系我们,向我们订购产品,折叠仓储笼钢托盘货架,搬运车液压搬动车等都有。.
June 12
洁 胡wrote:
您好!我在论坛上看到您发的关于CORAL sss 材质的帖子。我下了那个MEL文件,可是不知道为什么,在运行MEL时并不弹出小UI。我急切地想知道关于这个珊瑚材质的相关内容,如果可以的话,请在您有空的时候恢复我。QQ67205692    EMAIL   nmghujie@hotmail.com    谢谢!
May 14
利昌 张wrote:
您好,看你的MEL应用的非常好,我是个初学者,很想知道MEL的学习方法,望大哥指点迷津...
Sept. 21

Jay in Tiny Globe

VFX Artist from China
8/13/2006

"Set out for Lover" Finished

感谢支持的人,更感谢支持的中国人,共和国万岁。
7/25/2006

关于放弃Mental Images TD一职

只能说是人各有志。
So many men,So many minds.
7/6/2006

mel实现中键拖拽

global proc tgDragWindow() {
 if(`window -q -exists "tgDragWindow"`) deleteUI "tgDragWindow";
 window "tgDragWindow";
   columnLayout;
   textScrollList
   -allowAutomaticSelection 1
   -dgc ("nameOfAppend")
   -numberOfRows 2
    -append "drag1" -append "drag2"
   -sc ("print \"aaa\"");
   textScrollList
   -allowAutomaticSelection 1
   -dpc ("addItem")
   -numberOfRows 10
    -append "";
 showWindow "tgDragWindow";
}

global proc string[] nameOfAppend(string $dragControl,int $dragPositionX,int $dragPositionY,int $aidKey) {
 if ($dragPositionY<13) textScrollList -e -selectIndexedItem 1 $dragControl;
 else if ($dragPositionY>13) textScrollList -e -selectIndexedItem 2 $dragControl;
 string $nameOfAppend_Output[] = `textScrollList -q -selectItem $dragControl`;
 print (">>>>>>>>>>>>>>>>>>>>>\n");
 print ("$dragControl = " + $dragControl + "\n");
 print ("$dragPositionX = " + $dragPositionX+ " pixel from the left of tgDragWindow\n");
 print ("$dragPositionY = " + $dragPositionY+ " pixel from the top of tgDragWindow\n");
 switch ($aidKey) {
     case 0:
   print ("$aidKey = NONE\n");
         break;
     case 1:
   print ("$aidKey = Shift\n");
         break;
     case 2:
   print ("$aidKey = CTRL\n");
         break;
     case 3:
   print ("$aidKey = CTRL + Shift\n");
         break;
 }
 print ("OUTPUT = " + $nameOfAppend_Output[0] + "\n>>>>>>>>>>>>>>>>>>>>>\n");
 
 return {$nameOfAppend_Output[0]};
}

global proc addItem(string $dragControl,string $dropControl,string $nameOfAppend[],int $dropPositionX,int $dropPositionY,int $actionType) {
 print ("$dragControl = " + $dragControl + "\n");
 print ("$dropControl = " + $dropControl+ "\n");
 print ("$nameOfAppend = " + $nameOfAppend[0] + "\n");
 print ("$dropPositionX = " + $dropPositionX + " pixel from the left of tgDragWindow\n");
 print ("$dropPositionY = " + $dropPositionY + " pixel from the top of tgDragWindow\n");
 switch ($actionType) {
     case 1:
   print ("$actionType = Move\n");
         break;
     case 2:
   print ("$actionType = Copy\n");
         break;
     case 3:
   print ("$actionType = Link\n");
         break;
 }
 textScrollList -e -append $nameOfAppend[0] $dropControl;
}
6/18/2006

BRDF Shader

很偶然的机会在CGWorld看到了BRDF(双向反射率分布函数)的光照模型,
写在很小的一个角落里面,很简略得介绍了BRDF,
BRDF在形式上表现为三个角度得三维函数,既:
照明方向与法线方向所成的角度;
视角方向与法线方向所成的角度;
与法线垂直的平面上的照明方向与视角方向之间所乘的角度;

但是这个三维函数不是简单的数学公式,
而是需要用科学试验获得的经验公式(插值复原),
我在maya中模拟的只是最简单最基本的BRDF模型,
而且用多项三角函数代替了经验公式,效果如下。
BRDF最经典的应用是布料。
 
 
由于布料表面由许多精细的小结构(次微观结构)构成,
所以它的反光特性就显得很复杂。
BRDF试图通过一个宏观的光照模型来改概括些小结构的视觉效果。
双向反射率分布函数的数学定义就是在一定条件下(好比一定的视角),
反射光强和入射光强的比值。

BRDF大部分时候都能体现各向异性,
并且高光和非高光部分都能随着视角的变化而变化。
(ps.只是高光随着视角变化,blinn就能做到)

并且,BRDF的系数是一个经验系数。
eg.Maya中有一个表面朝向率,
其实就是表面法线(Normal Camera)和视角(Ray Direction)夹角A的余弦值cosA
如果把这个值赋给材质的自发光属性,那么可以这么描述:
incandescenceR = incandescenceG = incandescenceB = cosA
我所做到的也只停留在这一步。
但是BRDF是一个经验函数,它应该表示为:
incandescenceR = incandescenceG = incandescenceB = K·cosA
而且这个K会随着A的变化而变化,
只有达到了这一步,布料才会看上去更真实。
__________________
6/17/2006

梦中的顿悟

这个礼拜写了一个maya导权重的mel,叫做Sweet Baby。
之所以取这个这个名字是因为这个mel能处理模型拓扑变化的情况,
就像Sweet Baby一样甜。
Sweet Baby的作用正是maya默认import WeightMap所办不到的,
但是它有一个致命的缺陷,也是maya的通病:
maya所bake的map在uv Shell边缘处都会有锯齿,
在读取map的时候100%造成采样不正确。
因此,我动了一下脑筋,提出了tolerance sample的算法:
凡是uv shell边缘采样,均往里便宜一小段距离。
尽管这样,还是有千分之一的点会采样错误。
 
今天早上做梦,梦见动画督导不能接受这千分之一的错误,要求改进。
我在梦里便完成了新算法的构想。
 
新的算法里不再采用maya exprot的数据,
而是采用自己构架的mel 将 vertex<->UV<->Weight的数据记录下来。
并动态的将UV大小规类,以便加速读取:0-0.1,0.1-0.2……
import时采用这样的策略:
原来就存在的点,直接读取,由于已经将uv规类,所以遍历很快。
新加的点expand uv后读取周边weight数据,
并根据这点到各点的距离加权求和;
如果expand一次以后仍然都是新的点,则继续expand,
直到出现至少两个旧点为止。