2010년 5월 31일 월요일

Explicit Light Cache Control

illuminance("category", ..., "lightcache", "reuse") 이건 default set
illuminance("category", ..., "lightcache", "refresh")
이것때문에 상당한 삽질했다.

2010년 5월 25일 화요일

[RSL] string 만들기...

uniform float i = 0;
string ic;

ic = format("%d", i);
txfile = concat("filename", "_u", ic, ".tex");

이렇게하면 txfile = filename_u0.tex 가 된다.

2010년 5월 11일 화요일

Firefox 3.6 and Java on Linux

ln -s /usr/java/jre1.6.0_20/lib/i386/libnpjp2.so /opt/firefox/plugins/

RenderMan Doc을 보기위한 필~수 plugin.

Message Passing v.2(srf to lgt)

surface shader에서의 연산된 color 값을 light shader로 보내려고하는 목적은 bake light을 만들기위함이다.
해서 illuminance loop의 결과 값(diffuse)을 특정 light shader로 보내야한다.

앞에서 언급한바에 의하면 illuminance loop이전에 extern value를 설정하여야 한다.
이를 해결하기위해 light category를 이용하기로 한다.

2010년 5월 9일 일요일

Message Passing v.1(srf to lgt)

Message Passing을 충분히 이해했다고 생각했는데, 상당히 부족한 수준인것 같다.
최근 문제가 생긴부분이 Surface Shader의 특정 color 값을 Light Shader로 보내는 부분이다. 이해도가 떨어지다보니 글을 쓰기도 힘들다.

surface shader :
    output varying color __mycolor = 0;

light shader:
    color mycolor = 0;
    surface("__mycolor", mycolor);

이런식을 기본적으로 생각했었는데, 몇일전 사무실에서 시도하다 실패했다.
color 값이 light shader로 넘어가지 않았다.

여러가지 방법을 시도해본 결과,
surface shader 에서의 illuminance loop과 light shade 에서의 illuminate, solar 등에 대한 이해부족으로 인한 당연한 결과가 아닌가싶다.
참고로 illuminance loop이 돌기전 extern value를 설정하면 아무런 문제가 되지 않는다.

ex. 1
surface
base_srf(
float Kd = 1;
color lgtcolor = color(1);
output varying color __surfcolor = 0;)
{
normal Nn = normalize(N);
vector Nf = faceforward(Nn, I);

__surfcolor = lgtcolor;

color df = diffuse(Nf);

Ci = df;
}


light
base_lgt(
float intensity = 1;)
{
color lgtcolor = 1;
surface("__surfcolor", lgtcolor);
printf("%f, %f, %f\n", lgtcolor[0], lgtcolor[1], lgtcolor[2]);

point from = point "shader" (0,0,0);
vector dir = (0,0,1);

illuminate(from, dir, PI/2) {
Cl = intensity * lgtcolor;
}
}


위에서 언급했던 방법으로 간단하게 shader를 만들었다.

ex. 2
surface
base_srf(
float Kd = 1;
color lgtcolor = color(1);)
{
normal Nn = normalize(N);
color df = 0;

illuminance(P, Nn, PI/2, "send:light:__surfcolor", lgtcolor)
{
float k = Nn.normalize(L);
df += k * Cl;
}
Ci = df;
}


light
base_lgt(
float intensity = 1;
output varying color __surfcolor = 0;)
{
point from = point "shader" (0,0,0);
vector dir = (0,0,1);

illuminate(from, dir, PI/2) {
Cl = intensity * __surfcolor;
}
}


결과는 위의 방법과 같으나 이와 같은 방법으로도 message passing이 가능하다.
RMS 1.0에서는이와 같은 방법을 사용하고 있다.

2010년 5월 4일 화요일

Screen Capture Elite for Firefxo

https://addons.mozilla.org/ko/firefox/addon/66589/developers/roadblock

상당히 마음에 든다.

RSL Information Function - option

float option( string name; output type variable )
Table 15.5 Data names known to the option function

















NameType Description
"Format"uniform float[3]The resolution (x, y) and pixel aspect ratio.
"DeviceResolution"uniform float[3] The resolution (x, y) and pixel aspect ratio.  These are usually the three numbers passed to RiFormat, but may be different when RiFrameAspectRatioor RiScreenWindow are non-square.
"FrameAspectRatio"uniform floatFrame aspect ratio.
"CropWindow"uniform float[4]Boundaries of the crop window.
"DepthOfField"uniform float[3]fstop, focallength, focaldistance.
"Shutter"uniform float[2]Shutter open and close time.
"Hider"uniform stringThe name of the active hider.
"Clipping"uniform float[2]Near and far clip depths.

RSL Information Function - attribute

float attribute( string name, output type variable )

Table 15.4 Data names known to the attribute function
   Name                                                    Type
"ShadingRate"uniform float
"Sides"uniform float
"matte"uniform float
"GeometricApproximation:motionfactor"uniform float
"displacementbound:sphere" *uniform float
"displacementbound:coordinatesystem" *uniform string
"identifier:name" *uniform string
* note that "displacementbound:sphere' does not return the value exactly as specified in the RIB file, but rather returns its length in the coordinate system returned by "displacementbound:coordinatesystem".


ex. 본인이 제일 많이 쓰는 스타일은...
string rayblur;
if (attribute("user:rayblur", rayblur) == 1) {
    ... ... ... ...
}

2010년 5월 3일 월요일

CentOS - wine install

EPEL software repository를 설치.
http://fedoraproject.org/wiki/EPEL/FAQ#howtouse

정말 편하게 wine이 설치된다. 브라보~

flashplayer 10때문에...

flashplayer 10.0 r45 버전와 Firefox 3.6의 궁합은 완전 최악이다. Naver 사이트에 접속하면 gecko 블라블라 에러를 내며 firefox가 죽는다.
뭔가 잘못했겠지하면서 이것저것 해봐도 역시나... flash가 있는 사이트만 들어가면 죽기시작.

시스템 새로 설치하고 별짓 다 하다가... 9버전 플러그인을 사용하니 괜찮다. ^^;

다음날...
출근하자마자 사무실 시스템 셋팅을 확인해보니 flashplyaer 10.0 r45, Firefox 3.6을 사용하고있는데 별 문제가 없다. 뭐가 문제인지...