Archive

Archive for June, 2007

Converting .fx to CgFX

June 23rd, 2007 No comments

FX Composer 2안에 이런 것이 있었다. 아주 운이 좋은 것 같다. ㅋㅋㅋㅋㅋ
HLSL로 작성된 .fx 파일을 cgfx로 변환시켜 주는 방법이다.

FX Composer 2 comes with a Perl script that automatically converts HLSL .fx files
to CgFX. It is called “convert_fx.pl” and you can find it in the Utilities sub-folder of
the FX Composer 2 installed location.
convert_fx.pl outputs a copy of the input effect with Microsoft FX/CgFX 1.2
specific state assignments converted to the new OpenGL specific state assignments
in CgFX 1.5.
Perl must be installed for the script to run. (You can download a free Perl
distribution from www.activeperl.com.) To run the script, execute the following
command:

perl convert_fx.pl input.fx output.cgfx

Limitations

Multiple state assignments on a single line are not supported. If the input file
contains any lines similar to the following:
SrcBlend = One; DestBlend = Zero;

you must move these state assignments to their own line before running this script,
as shown below:
SrcBlend = One;
DestBlend = Zero;

State that has no direct OpenGL equivalent will not be changed; instead, this script
will add a comment to the line indicating that the state will have to be manually
updated. Search for “FIXME” in the output file to locate these problem states.
See the declaration of the unsupportedState array below for a list of state that is not
supported.

  • Sampler state inside a pass block is not supported by CgFX 1.5 or this script
    and will need to be manually moved into a sampler_state block.

  • This script only updates state assignments inside a pass or sampler_state block;
    it will not modify any shaders, annotations, or semantics.

Categories: dev:game Tags: , , , ,

Shader FX from Lumonix

June 23rd, 2007 No comments

사용자 삽입 이미지
캐나다 벤쿠버에 소재하고 있는 Lumonix라는 회사가 있다.
회사의 홈페이지 주소는 http://www.lumonix.net/ 이다.

이 회사에서 만든 제품중에 Shader FX 라는 제품이 있는데, 위 그림에서 보는 것과 같이 마치 Virtool이나 Combustion등의 넌 프로그래머들이 작업하는 방식으로 작업을 하면 shader effect파일이 나오도록 하는 맥스 플러그인 제품이다.

현재는 HLSL만 지원하고 있고 데모용으로 제공되는 공짜 프로그램은 제작할 수 있는 노드의 갯수에 제약이 있다.

프로그래밍을 모르는 디자이너의 쉐이더 개발에 도움이 될 것 같다.

Categories: dev:game Tags: , , ,

NVB Exporter for 3DS max 8

June 23rd, 2007 No comments

사용자 삽입 이미지
nVidia 사의 웹사이트에 가면 NVB Exporter가 있다. 맥스에서 NVB라는 파일 포맷으로 데이
터를 뽑아주는 플러그인인데 그 곳에는 MAX 6용 까지 밖에 없다. 제공되는 nVidia 소스를 바탕으로 Max 8용으로 다시 컴파일만 했다. 모든 소스의 저작권은 nVidia에 있다.

nvbexporterformax8.zip
설치법은 압축파일을 열어서 dll파일은 맥스 루트 디렉토리에 놓고 dle 파일은 맥스의 플러그인 디렉토리에 놓으면 된다.

Categories: dev:game Tags: , ,

DDS Surface Format

June 15th, 2007 No comments
DDS Surface Format

Direct X SDK 안에 있는 Texture Tool에서 발췌

No Byte Format Description
1 Unsigned 8-bit A4L4 8-bit using 4 bits each for alpha and luminance.
2 Unsigned 8-bit A8 8-bit alpha only
3 Unsigned 8-bit L8 8-bit luminance only
4 Unsigned 8-bit P8
5 Unsigned 8-bit R3G3B2
6 Unsigned 16-bit A1R5G5B5
7 Unsigned 16-bit A4R4G4B4
8 Unsigned 16-bit A8L8
9 Unsigned 16-bit A8P8
10 Unsigned 16-bit A8R3G3B2
11 Unsigned 16-bit L16
12 Unsigned 16-bit R5G6B5
13 Unsigned 16-bit X1R5G5B5
14 Unsigned 16-bit X4R4G4B4
15 Unsigned 24-bit R8G8B8
16 Unsigned 32-bit A2B10G10R10
17 Unsigned 32-bit A2R10G10B10
18 Unsigned 32-bit A8B8G8R8
19 Unsigned 32-bit A8R8G8B8
20 Unsigned 32-bit G16R16
21 Unsigned 32-bit X8B8G8R8
22 Unsigned 32-bit X8R8G8B8
23 Unsigned 64-bit A16B16G16R16
24 Signed 16-bit CxV8U8 16-bit normal compression format. The texture sampler computes the C channel from: C=sqrt(1-U2-V2)
25 Signed 16-bit V8U8 16-bit bump-map format using 8 bits each for u and v data.
26 Signed 32-bit Q8W8V8U8 32-bit bump-map format using 8 bits for each channel.
27 Signed 32-bit V16UI6 32-bit bump-map format using 16 bits for each channel.
28 Signed 64-bit Q16W16V16U16 64-bit bump-map format using 16 bits for each component.
29 Mixed 16-bit L6V5U5 16-bit bump-map format with luminance using 6 bits for luminance, and 5 bits each for v and u.
30 Mixed 32-bit A2W10V10U10 32-bit bump-map format using 2 bits for alpha and 10 bits each for w, v, and u.
31 Mixed 32-bit X8L8V8U8 32-bit bump-map format with luminance using 8 bits for each channel.
32 Four CC 4-bit DXT1 Compressed texture format with 1-bit alpha,
33 Four CC 8-bit DXT2 Compressed texture format with 4-bit premultiplied alpha
34 Four CC 8-bit DXT3 Compressed texture format with 4-bit nonpremultiplied alpha
35 Four CC 8-bit DXT4 Compressed texture format with interpolated premultipled alpha
36 Four CC 8-bit DXT5 Compressed texture format with interpolated nonpremultiplied alpha
37 Four CC 16-bit G8R8_G8B8 A 16-bit packed RGB format analogous to YUY2 (Y0U0, Y1V0, Y2U2, etc.). It requires a pixel pair in order to properly represent the color value. The first pixel in the pair contains 8 bits of green (in the high 8 bits) and 8 bits of red (in the low 8 bits). The second pixel contains 8 bits of green (in the high 8 bits) and 8 bits of blue (in the low 8 bits). Together, the two pixels share the red and blue components, while each has a unique green component (G0R0, G1B0, G2R2, etc.). The texture sampler does not normalize the colors when looking up into a pixel shader; they remain in the range of 0.0f to 255.0f. This is true for all programmable pixel shader models. For the fixed function pixel shader, the hardware should normalize to the 0.f to 1.f range and essentially treat it as the YUY2 texture. Hardware that exposes this format must have the PixelShader1xMaxValue member of D3DCAPS9 set to a value capable of handling that range.
38 Four CC 16-bit R8G8_B8G8 A 16-bit packed RGB format analogous to UYVY (U0Y0, V0Y1, U2Y2, etc.). It requires a pixel pair in order to properly represent the color value. The first pixel in the pair contains 8 bits of green (in the low 8 bits) and 8 bits of red (in the high 8 bits). The second pixel contains 8 bits of green (in the low 8 bits) and 8 bits of blue (in the high 8 bits). Together, the two pixels share the red and blue components, while each has a unique green component (R0G0, B0G1, R2G2, etc.). The texture sampler does not normalize the colors when looking up into a pixel shader; they remain in the range of 0.0f to 255.0f. This is true for all programmable pixel shader models. For the fixed function pixel shader, the hardware should normalize to the 0.f to 1.f range and essentially treat it as the YUY2 texture. Hardware that exposes this format must have PixelShader1xMaxValue member of D3DCAPS9 set to a value capable of handling that range.
39 Four CC 16-bit UYVY UYVY format (PC98 compliance)
40 Four CC 16-bit YUY2 YUY2 format (PC98 compliance)
41 Floating-Point 16-bit R16F 16-bit float format using 16 bits for the red channel.
42 Floating-Point 32-bit G16R16F 32-bit float format using 16 bits for the red channel and 16 bits for the green channel.
43 Floating-Point 64-bit A16B16G16R16F 64-bit float format using 16 bits for the each channel (alpha, blue, green, red).
44 IEEE Floating-Point 32-bit R32F 32-bit float format using 32 bits for the red channel.
45 IEEE Floating-Point 64-bit G32R32F 64-bit float format using 32 bits for the red channel and 32 bits for the green channel.
46 IEEE Floating-Point 128-bit A32B32G32R32F 128-bit float format using 32 bits for the each channel (alpha, blue, green, red).
Categories: dev:dcc Tags: