Slang's .plan

スポンサーサイト

上記の広告は1ヶ月以上更新のないブログに表示されています。
新しい記事を書く事で広告が消せます。

11/15/06

Geometry Shaders At Work



I've just experimented with the new GL_EXT_geometry_shader4 extension using GeForce 8800 (G80) feature set emulation and GLSL compiler device support enabled by NVemulate.

o GPU: NVIDIA GeForce 6800 GT (NV40)
o Driver: NVIDIA ForceWare 96.89 for 32-bit Windows XP
o OpenGL Version: 2.1.0
o GLSL Version: 1.20 NVIDIA via Cg compiler

Here's the test geometry shader (output as low-level GL_NV_geometry_program4):
----------------------------------------------------------------
!!NVgp4.0
PRIMITIVE_IN TRIANGLES;
PRIMITIVE_OUT TRIANGLE_STRIP;
VERTICES_OUT 6;
# cgc version 1.6.0011, build date Oct 16 2006 23:39:35
# command line args:
#vendor NVIDIA Corporation
#version 1.6.0.11
#profile gp4gp
#program main
#var float4 gl_Position : $vout.POSITION : HPOS : -1 : 1
#var float4 gl_PositionIn[0] : $vin.VERTEX[0].POSITION : HPOS[0][32] : -1 : 1
#var float4 gl_PositionIn[1] : $vin.VERTEX[1].POSITION : HPOS[1][32] : -1 : 1
#var float4 gl_PositionIn[2] : $vin.VERTEX[2].POSITION : HPOS[2][32] : -1 : 1
TEMP R0, R1;
TEMP RC, HC;
MOV.F result.position, vertex[0].position;
EMIT;
MOV.F result.position, vertex[1].position;
EMIT;
MOV.F result.position, vertex[2].position;
EMIT;
ENDPRIM;
MOV.F R0, vertex[1].position;
ADD.F R0, vertex[0].position, R0;
ADD.F R0, R0, vertex[2].position;
MUL.F R0, R0, {0.33333334, 0, 0, 0}.x;
MAD.F R1, vertex[0].position, {2, 0, 0, 0}.x, -R0;
MOV.F result.position, R1;
EMIT;
MAD.F R1, vertex[1].position, {2, 0, 0, 0}.x, -R0;
MOV.F result.position, R1;
EMIT;
MAD.F R0, vertex[2].position, {2, 0, 0, 0}.x, -R0;
MOV.F result.position, R0;
EMIT;
ENDPRIM;
END
# 21 instructions, 2 R-regs
----------------------------------------------------------------

It's quite easy to use as usual. But anyway software emulation is damn slow, so I really need to get a GeForce 8800 video card for further experimentations like stencil shadow volumes extraction and thus IQ/PF comparison against the omnidirectional cubic shadow mapping that I've worked on so far (I am now much more interested in the CUDA technology rather than geometry shaders stuff, though).
スポンサーサイト
| Top Page |
上記広告は1ヶ月以上更新のないブログに表示されています。新しい記事を書くことで広告を消せます。