Code: Select all
Vendor: NVIDIA Corporation
Renderer: GeForce FX 5200/PCI/SSE/3DNOW!
Version: 2.0.1
Max simultaneous textures: 4
Max texture size: 4096
Point size range: 1.000000 - 63.375000
Supported Extensions:
GL_ARB_depth_texture
GL_ARB_fragment_program
GL_ARB_fragment_program_shadow
GL_ARB_fragment_shader
GL_ARB_half_float_pixel
GL_ARB_imaging
GL_ARB_multisample
GL_ARB_multitexture
GL_ARB_occlusion_query
GL_ARB_pixel_buffer_object
GL_ARB_point_parameters
GL_ARB_point_sprite
GL_ARB_shadow
GL_ARB_shader_objects
GL_ARB_shading_language_100
GL_ARB_texture_border_clamp
GL_ARB_texture_compression
GL_ARB_texture_cube_map
GL_ARB_texture_env_add
GL_ARB_texture_env_combine
GL_ARB_texture_env_dot3
GL_ARB_texture_mirrored_repeat
GL_ARB_texture_rectangle
GL_ARB_transpose_matrix
GL_ARB_vertex_buffer_object
GL_ARB_vertex_program
GL_ARB_vertex_shader
GL_ARB_window_pos
GL_S3_s3tc
GL_EXT_texture_env_add
GL_EXT_abgr
GL_EXT_bgra
GL_EXT_blend_color
GL_EXT_blend_func_separate
GL_EXT_blend_minmax
GL_EXT_blend_subtract
GL_EXT_compiled_vertex_array
GL_EXT_Cg_shader
GL_EXT_draw_range_elements
GL_EXT_fog_coord
GL_EXT_framebuffer_object
GL_EXT_multi_draw_arrays
GL_EXT_packed_depth_stencil
GL_EXT_packed_pixels
GL_EXT_paletted_texture
GL_EXT_pixel_buffer_object
GL_EXT_point_parameters
GL_EXT_rescale_normal
GL_EXT_secondary_color
GL_EXT_separate_specular_color
GL_EXT_shadow_funcs
GL_EXT_shared_texture_palette
GL_EXT_stencil_two_side
GL_EXT_stencil_wrap
GL_EXT_texture3D
GL_EXT_texture_compression_s3tc
GL_EXT_texture_cube_map
GL_EXT_texture_edge_clamp
GL_EXT_texture_env_combine
GL_EXT_texture_env_dot3
GL_EXT_texture_filter_anisotropic
GL_EXT_texture_lod
GL_EXT_texture_lod_bias
GL_EXT_texture_object
GL_EXT_texture_sRGB
GL_EXT_timer_query
GL_EXT_vertex_array
GL_HP_occlusion_test
GL_IBM_rasterpos_clip
GL_IBM_texture_mirrored_repeat
GL_KTX_buffer_region
GL_NV_blend_square
GL_NV_copy_depth_to_color
GL_NV_depth_clamp
GL_NV_fence
GL_NV_float_buffer
GL_NV_fog_distance
GL_NV_fragment_program
GL_NV_fragment_program_option
GL_NV_half_float
GL_NV_light_max_exponent
GL_NV_multisample_filter_hint
GL_NV_occlusion_query
GL_NV_packed_depth_stencil
GL_NV_pixel_data_range
GL_NV_point_sprite
GL_NV_primitive_restart
GL_NV_register_combiners
GL_NV_register_combiners2
GL_NV_texgen_reflection
GL_NV_texture_compression_vtc
GL_NV_texture_env_combine4
GL_NV_texture_expand_normal
GL_NV_texture_rectangle
GL_NV_texture_shader
GL_NV_texture_shader2
GL_NV_texture_shader3
GL_NV_vertex_array_range
GL_NV_vertex_array_range2
GL_NV_vertex_program
GL_NV_vertex_program1_1
GL_NV_vertex_program2
GL_NV_vertex_program2_option
GL_SGIS_generate_mipmap
GL_SGIS_texture_lod
GL_SGIX_depth_texture
GL_SGIX_shadow
GL_SUN_slice_accum
GL_WIN_swap_hint
WGL_EXT_swap_control
Code: Select all
Vertex shader source:
1: uniform struct {
2: vec3 direction;
3: vec3 diffuse;
4: vec3 specular;
5: vec3 halfVector;
6: } lights[1];
7: varying vec2 diffTexCoord;
8: varying vec2 normTexCoord;
9: varying vec3 lightDir0;
10: uniform float textureOffset;
11: attribute vec3 tangent;
12:
13: void main(void)
14: {
15: float nDotVP;
16: nDotVP = max(0.0, dot(gl_Normal, lights[0].direction));
17: vec3 bitangent = cross(gl_Normal, tangent);
18: lightDir0.x = dot(tangent, lights[0].direction);
19: lightDir0.y = dot(-bitangent, lights[0].direction);
20: lightDir0.z = dot(gl_Normal, lights[0].direction);
21: diffTexCoord = gl_MultiTexCoord0.st;
22: diffTexCoord.x += textureOffset;
23: normTexCoord = gl_MultiTexCoord1.st;
24: gl_Position = ftransform();
25: }
Fragment shader source:
1: uniform vec3 ambientColor;
2: vec4 diff = vec4(ambientColor, 1.0);
3: uniform vec3 lightcolor0;
4: varying vec2 diffTexCoord;
5: uniform sampler2D diffTex;
6: varying vec2 normTexCoord;
7: varying vec3 lightDir0;
8: uniform sampler2D normTex;
9:
10: void main(void)
11: {
12: vec4 color;
13: vec3 n = texture2D(normTex, normTexCoord.st).xyz * vec3(2.0, 2.0, 2.0) - vec3(1.0, 1.0, 1.0);
14: float l;
15: l = max(0.0, dot(lightDir0, n)) * clamp(lightDir0.z * 8.0, 0.0, 1.0);
16: diff.rgb += l * lightcolor0;
17: color = texture2D(diffTex, diffTexCoord.st);
18: gl_FragColor = color * diff;
19: }
Vertex shader source:
1: uniform struct {
2: vec3 direction;
3: vec3 diffuse;
4: vec3 specular;
5: vec3 halfVector;
6: } lights[1];
7: uniform float shininess;
8: uniform vec3 ambientColor;
9: varying vec4 diff;
10: varying vec4 spec;
11: varying vec2 diffTexCoord;
12: varying vec2 nightTexCoord;
13: varying float totalLight;
14: uniform float textureOffset;
15:
16: void main(void)
17: {
18: float nDotVP;
19: float nDotHV;
20: diff = vec4(ambientColor, 1.0);
21: nDotVP = max(0.0, dot(gl_Normal, lights[0].direction));
22: nDotHV = max(0.0, dot(gl_Normal, lights[0].halfVector));
23: diff.rgb += lights[0].diffuse * nDotVP;
24: spec.rgb += lights[0].specular * (pow(nDotHV, shininess) * nDotVP);
25: totalLight += nDotVP;
26: totalLight = 1.0 - totalLight;
27: totalLight = totalLight * totalLight * totalLight * totalLight;
28: diffTexCoord = gl_MultiTexCoord0.st;
29: diffTexCoord.x += textureOffset;
30: nightTexCoord = gl_MultiTexCoord1.st;
31: gl_Position = ftransform();
32: }
Fragment shader source:
1: varying vec4 diff;
2: varying vec4 spec;
3: varying vec2 diffTexCoord;
4: uniform sampler2D diffTex;
5: varying vec2 nightTexCoord;
6: uniform sampler2D nightTex;
7: varying float totalLight;
8:
9: void main(void)
10: {
11: vec4 color;
12: color = texture2D(diffTex, diffTexCoord.st);
13: gl_FragColor = color * diff + color.a * spec;
14: gl_FragColor += texture2D(nightTex, nightTexCoord.st) * totalLight;
15: }
Error linking shader program:
Vertex info
-----------
Internal error: assembly compile error for vertex shader at offset 1445:
-- error message --
line 39, column 19: error: invalid operand variable
line 46, column 33: error: invalid operand variable
-- internal assembly text --
!!VP2.0
# cgc version 1.5.0000, build date Nov 11 2005 14:12:07
# command line args:
#vendor NVIDIA Corporation
#version 1.0.02
#profile vp30
#program main
#semantic gl_ModelViewProjectionMatrixTranspose
#semantic lights
#semantic shininess
#semantic ambientColor
#semantic textureOffset
#var float3 gl_Normal : $vin.NORMAL : NORMAL : -1 : 1
#var float4 gl_Vertex : $vin.POSITION : POSITION : -1 : 1
#var float4 gl_MultiTexCoord0 : $vin.TEXCOORD0 : TEXCOORD0 : -1 : 1
#var float4 gl_MultiTexCoord1 : $vin.TEXCOORD1 : TEXCOORD1 : -1 : 1
#var float4 gl_Position : $vout.POSITION : HPOS : -1 : 1
#var float4x4 gl_ModelViewProjectionMatrixTranspose : : c[0], 4 : -1 : 1
#var float3 lights[0].direction : : c[4] : -1 : 1
#var float3 lights[0].diffuse : : c[6] : -1 : 1
#var float3 lights[0].specular : : c[10] : -1 : 1
#var float3 lights[0].halfVector : : c[8] : -1 : 1
#var float shininess : : c[9] : -1 : 1
#var float3 ambientColor : : c[7] : -1 : 1
#var float4 diff : $vout.TEX0 : TEX0 : -1 : 1
#var float2 diffTexCoord : $vout.TEX1 : TEX1 : -1 : 1
#var float totalLight : $vout.TEX2 : TEX2 : -1 : 1
#var float textureOffset : : c[11] : -1 : 1
#var float2 nightTexCoord : $vout.TEX4 : TEX4 : -1 : 1
#var float4 spec : $vout.TEX3 : TEX3 : -1 : 1
#const c[5] = 0 1
BB1:
DP3 R0.x, v[2], c[4];
MAX R0.x, R0, c[5];
MUL R1.xyz, R0.x, c[6];
ADD o[TEX0].xyz, R1, c[7];
DP3 R0.y, v[2], c[8];
MAX R1.xy, R0.y, c[5].x;
ADD R0.y, R0.x, o[TEX2].x;
ADD R0.y, -R0, c[5];
MOV R1.z, c[9].x;
LIT R0.z, R1.xyzz;
MUL R0.x, R0, R0.z;
MUL R0.w, R0.y, R0.y;
MUL R0.z, R0.w, R0.y;
MAD o[TEX3].xyz, R0.x, c[10], o[TEX3];
MUL o[TEX2].x, R0.z, R0.y;
MOV o[TEX4].xy, v[9];
MOV o[TEX0].w, c[5].y;
ADD o[TEX1].x, v[8], c[11];
MOV o[TEX1].y, v[8];
DP4 o[HPOS].w, v[0], c[3];
DP4 o[HPOS].z, v[0], c[2];
DP4 o[HPOS].y, v[0], c[1];
DP4 o[HPOS].x, v[0], c[0];
END
# 23 instructions, 2 R-regs
Vertex shader source:
1: uniform struct {
2: vec3 direction;
3: vec3 diffuse;
4: vec3 specular;
5: vec3 halfVector;
6: } lights[1];
7: uniform vec3 ambientColor;
8: varying vec4 diff;
9: varying vec2 diffTexCoord;
10: uniform float textureOffset;
11:
12: void main(void)
13: {
14: float nDotVP;
15: diff = vec4(ambientColor, 1.0);
16: nDotVP = max(0.0, dot(gl_Normal, lights[0].direction));
17: diff.rgb += lights[0].diffuse * nDotVP;
18: diffTexCoord = gl_MultiTexCoord0.st;
19: diffTexCoord.x += textureOffset;
20: gl_Position = ftransform();
21: }
Fragment shader source:
1: varying vec4 diff;
2: varying vec2 diffTexCoord;
3: uniform sampler2D diffTex;
4:
5: void main(void)
6: {
7: vec4 color;
8: color = texture2D(diffTex, diffTexCoord.st);
9: gl_FragColor = color * diff;
10: }