Porting Mirko's Ravers Nature for ATi

Started by
85 comments, last by vincoof 21 years, 1 month ago
Some good and bad news.

The bad news is that even the no_shader executable hangs the system. The good news being it means shaders are not causing the hang ! (well, at least if you really "deactivated" shaders in the no_shader version). Both executables hangs at the same time. For what I can see, the no_shader version shows a grey-ish terrain and the shader version shows a coloured terrain and looks fine apart the fact that the fog in the distance seems activated (like GL_FOG was enabled).

So, now the question is : what hangs the system, if not shaders ? I think it has to do with some feature that starts (or stops?) when the fade from black is finished.
Advertisement
I have an ATI 8500 and will test it as soon as I get home (sitting @ school now...)

The preious one ran without crashing on my system, but didn''t show any terrain, just a big sun...


// Website // Google // GameDev // NeHe // MSDN //
~neoztar "Any lock can be picked with a big enough hammer"my website | opengl extensions | try here firstguru of the week | msdn library | c++ faq lite
The same happens to me when the vertex program fails. Have you downloaded the latest driver ? And does the ARB_vertex_program string appears in the extension list in the log file ?
The entire log file follows:

File open at 09:43:42 02/13/03
-----------------------------------------------------------------
* Logging Class by Mirko Teran-Ravnikar
* Created for Unity2 Engine
-----------------------------------------------------------------
- Initializing window
- DirectInput initiation...
- OpenGL system info :
- Renderer : Radeon 8500 DDR x86/MMX/3DNow!
- Vendor : ATI Technologies Inc.
- Verison : 1.3.3561 WinXP Release
- Extentions : GL_ARB_multitexture GL_EXT_texture_env_add GL_EXT_compiled_vertex_array GL_S3_s3tc GL_ARB_point_parameters 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_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_mirrored_repeat GL_ARB_transpose_matrix GL_ARB_vertex_blend GL_ARB_vertex_program GL_ARB_window_pos GL_ATI_element_array GL_ATI_envmap_bumpmap GL_ATI_fragment_shader GL_ATI_map_object_buffer GL_ATI_pn_triangles GL_ATI_texture_env_combine3 GL_ATI_texture_mirror_once GL_ATI_vertex_array_object GL_ATI_vertex_attrib_array_object GL_ATI_vertex_streams GL_ATIX_texture_env_combine3 GL_ATIX_texture_env_route GL_ATIX_vertex_shader_output_point_size 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_clip_volume_hint GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_multi_draw_arrays GL_EXT_packed_pixels GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_stencil_wrap GL_EXT_texgen_reflection 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_bias GL_EXT_texture_object GL_EXT_texture_rectangle GL_EXT_vertex_array GL_EXT_vertex_shader GL_HP_occlusion_test GL_KTX_buffer_region GL_NV_texgen_reflection GL_NV_blend_square GL_NV_occlusion_query GL_SGI_color_matrix GL_SGI_texture_edge_clamp GL_SGIS_texture_border_clamp GL_SGIS_texture_lod GL_SGIS_generate_mipmap GL_SGIS_multitexture GL_SUN_multi_draw_arrays GL_WIN_swap_hint WGL_EXT_extensions_string WGL_EXT_swap_control
Point Sprites NOT supported.
NV Register Combiners NOT supported.
NV VAR not supported : using system memory.
- Loading TrueType fonts from Arial
- ATi code-path supported
- Loading ARB vertex program: VP\TerrainBasic.ARBVP
- Cache allocated in system memory at address 0D7C0024
- Terrain heightmap generated in 287.898ms
- Creating QuadTree structure...(depth = 6)
- QuadTree build in 2.37556ms
- Demo Maneger stats:
- 1) Sunrise (19s)
- Total demo loop : 19s
- Init sequence complete...

[edited by - Extrarius on February 13, 2003 11:27:40 AM]
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
I''ve written the vertex program with some "Radeon-compatible" instructions. You could copy''n''paste it in the file VP\TerrainBasic.ARBVP :

  !!ARBvp1.0OPTION ARB_position_invariant;# Base Terrain Vertex Program :#  - Generate mapping coordinats#  - Combine(blend) base texture with slope texture#  - sun_DOT_normal + ambient light#  - Distance and height fog# (verison 1.4 : 8/10 instructions)ATTRIB iPos         = vertex.position;ATTRIB iNormal      = vertex.normal;PARAM  const0		= { 0, 0.5, 1, 2 };PARAM  cameraPos	= program.local[61];PARAM  sunDir		= program.local[62];PARAM  factors0		= program.local[63];PARAM  factors1		= program.local[64];# factors0 = globalAmbentLight, texture scale, detailFactor, fogFactor# factors1 = slope, slope-1.0, heightFogHeight, heightFogDensityTEMP   temp, distFog;OUTPUT oColor0		= result.color.primary;OUTPUT oColor1      = result.color.secondary;OUTPUT oTex0		= result.texcoord[0];OUTPUT oTex1		= result.texcoord[1];# Texture coordinats (same on unit 0 and 1)MOV temp, iPos;MOV temp.y, iPos.z;MOV temp.z, iPos.y;MUL oTex0.xy, temp, factors0.y;MUL oTex1.xy, temp, factors0.y;# color = (normal DOT sunDir) + ambientDP3 temp, iNormal, sunDir;ADD oColor0, temp, factors0.x;# slope factor# slope = (normal.y * slopeFactor) - slopeFactor + 1SUB temp, 0, factors1; # ATI does not support -1 factorMAD oColor0.w, iNormal.y, factors1.x, temp.y;# distance fogSUB distFog, iPos, cameraPos;DP3 distFog.w, distFog, distFog;# for just distance fog uncomment next line and delete all the rest#MUL oColor1, distFog.w, factors0.w;# height fog v2.0MAD temp.w, iPos.y, temp.w, factors1.z;MAX temp.w, temp.w, const0.x;# fog combine (height & distance)MAD oColor1, distFog.w, factors0.w, temp.w;END  

It uses one or two more instructions, so it should be slower, but the result is "theorically" the same. In "practice", it is better for Radeon cards.
I''ve thrown out just about all features. Terrain is now renderd using glVetex&glNormal calls. Sky is also gone. Just plain white BG. You *realy* must hate me by now, having to restart, everytime you test this. I''m realy sorry for it, but the more I search, the less I find.

http:\\www2.arnes.si\~uteran\RaversNature_ATi_3.zip

I''ll se what I can do with vertex program... why exacly is it faster?

You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
I''m currently dowloading your new version, and I''ll give feedback ... after reboot
I don''t hate you at all. It''s part of the game. *You* should hate us for not having been able to detect where the problem comes from so far

quote:
I''ll se what I can do with vertex program... why exacly is it faster?

I did say it was "better" but "slower". Old Radeon drivers do not like things such as swizzle or negation, so I replaced some of the instructions. People running older drivers could see the vertex program working better.
*reboot*

This time the log file is empty. Either it crashed before the log file is written to disk, or the file write crashed and the hard disk replaced the file by a default (empty) file. First case is more probable IMO.

It crashed on the loading screen. In the scene list, I could see two lines, then it crashed. That means the first scene was loaded correctly, and the second or the third crashed. I don''t know what, but you must be calling something bad. For instance, if your VAR class allocates memory on the server side (the graphics card memory) you may not succeed. Well, I''m speaking about VAR but it could be anything.
I ran the demo on GF4 (which runs very good, as usual) and saw that in fact two scenes are loaded. So, it does not crash with Radeon8500 when scenes are loading. It crashes when the terrain is being rendered.

The only difference between this crash and the crash of the previous demos is simple : this time I don't even see the terrain whereas with the previous demos (the ones zipped yersterday) I could barely see the terrain for about 1-2 seconds before crash.

And do you guess what I remarked ? This demo starts rendering the terrain WITHOUT the "fade from black" effect.
That is, when the terrain is rendered in the "fade from black" effect, it is protected ; and when that sequence (fade from black) finishes, it is not protected anymore. In other words, there is *something* you're doing or NOT doing in that "fade from black" sequence that you do or do not do in the rest of the scene. And that *thing* is causing the black screen. I really don't know what it is, but for sure there is at least *one* thing that appears or disappears.

[edited by - vincoof on February 13, 2003 3:22:15 PM]
I''m 99.9% sure it''s not fading function. There is not a single state changing command. Here is the code if you want:

  void UDemoScene::FadeIn( UColor color, float fTime ) {	if ( OverTime(fTime) ) return;	float fVal = 1.0f - curentTime/fTime;	glColor4f( color.cR, color.cG, color.cB, fVal );	DrawQuad2D();}  

and DrawQuad2D(); only calls a function to draw a full screen quad using plain glBegin/glEnd.. nothing special here... OverTime is just a couple of simple if checks...

Now I''ve thrown out just about everything. fadein/out, sky,.. and the other scene... just raw terrain.. If this doesn''t work I''m gonna open a new project and try from zero.

http:\\www2.arnes.si\~uteran\RaversNature_ATi_4.zip

You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.

This topic is closed to new replies.

Advertisement