Archived

This topic is now archived and is closed to further replies.

PixelShade & terrain - safe my time....

This topic is 5006 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi... I''ve implemented my terrain (heightmap terrain) with splat technic.. I render my buffer 2 times, and with 6 64x64 chunks I get 50 fps... I''ve done it in 3-4 weeks ... and now I''ve discovered that is possible to make it with PS 1.1 with a better performance... is true? I''ve wasted 4 weeks of my life? Do you advise me to learn pixel shade? I''m a bit frustrated... If your answer is yes I will have to throw away all my work... byezz

Share this post


Link to post
Share on other sites
Hi,

I am working on some terrain code aswell. I also have 64 x 64 chunks (4 chunks x 4 chunks = 16 chunks) .

I implemented it using texture splatting. I got about 250 FPS.

Then I implemented it using a simple PS shader (HLSL) just doing simple additive texture blending of 2 textures. No alpha maps.

I got about 300 FPS from this. So, about a 50 FPS increase.


I am using ATI RADEON 9800 PRO.


With the ATI''s I hear that they replicate the fixed function pipeline, using shaders. So even if your NOT using shaders, you really are. Thing is though, the shaders are probably a little bloated to support the general case. You can therefore, often get better performane by writing your own minimal shader manually.

Share this post


Link to post
Share on other sites
What kind of texture blending are you doing ? Alpha Maps? How many textures?


Your post caused me to go back and look at my pixel shader. I was doing a 2-pass additive blend (no alphas) and then realized a way to do it in just a single pass. I got a 100 FPS boost out of this.

So, I''m looking at ~ 250 FPS with texture splatting (no pixel shader) and ~ 400 FPS with the pixel shader.

Share this post


Link to post
Share on other sites
You didn''t waste time, you hopefully learned something.
It is essential that you do learn pixel and vertex shaders as
they will make your life a lot easyer.

Using HLSL you can probably replicate all your work
quickly

Share this post


Link to post
Share on other sites
I use 3 textures for chunks, plus 2 textures for alpha map...

First I render all chunck with opaque base texture, then I render others two splat-chuncks ( that together are smaller than chunk ) with the its texture and alpha map...

50 fps with my ATI Radeon 9600 pro and Athlon 3200+....


quote:

I got about 250 FPS.


Compliments... excellent performance.

quote:

You didn''t waste time, you hopefully learned something.


mmmmm... yes, but when I''ll use splat technic again?

quote:

Using HLSL you can probably replicate all your work
quickly


Ok... then I''ll search some tutorial and I''ll learn it..


thanks

Share this post


Link to post
Share on other sites
Besides, you now have a technique that works on cards which don''t support PS1.1. If you add detection code to your game as it starts up, you could switch between this method and the PS1.1, thus increasing the size of your potential audience...

Share this post


Link to post
Share on other sites
That comment about Fixed Function just isn''t true about ATi''s cards. It''s true about DirectX. At GDC this week, if you stop by AMD''s booth for their DirectX talk, you''ll see this. DirectX looks at the render states and write a shader for you. You should get speedups when going from FF->Programmable (even if they do the same stuff), because then you don''t have branch prediction. Is blending on? is Lighting turned on? etc.

Share this post


Link to post
Share on other sites
@bluechip: I think in your case it''s not a question of using pixel shader or not - problems should exist somewhere else. I would suggest to simplify the design & locate where''s the slowdown in your current implementation, before using pixel shader solely for speedup...
(just my little idea.. maybe I''m wrong)

Share this post


Link to post
Share on other sites
There is a little detail many people seem to forget: any optimization done in the pixel pipeline will only affect fillrate (pipeline delays, GPU <-> VRAM memory bandwidth, etc). Nothing more, nothing less.

This means in practice, that if you are not fillrate limited, such optimizations will give you an impressive framerate increase of exactly - zero.

gamelife hit the point: before optimizing anything, profile your code. Know your bottlenecks, and target them in your optimization. In your case, a have a very strong feeling that your problem has absolutely nothing to do with the pixel pipeline, nor with the geometry pipeline. You''re probably wasting cycles somewhere where you never imagined it (CPU side data streaming, culling, LOD stuff, etc).

So, happy profiling

Share this post


Link to post
Share on other sites
quote:
Original post by ngill
That comment about Fixed Function just isn''t true about ATi''s cards. It''s true about DirectX. At GDC this week, if you stop by AMD''s booth for their DirectX talk, you''ll see this. DirectX looks at the render states and write a shader for you. You should get speedups when going from FF->Programmable (even if they do the same stuff), because then you don''t have branch prediction. Is blending on? is Lighting turned on? etc.


it is true. >=9500 don''t have any fixed function in at all anymore. it''s not a dx thing.




If that''s not the help you''re after then you''re going to have to explain the problem better than what you have. - joanusdmentia

davepermen.net

Share this post


Link to post
Share on other sites
Is not easy to find bottlenecks...
because I don''t use LOD system, or culling system...

In my terrain there is only the brutal force ...

Each chunk has:
1 vertex buffer with 64x64 verticies,
3 index buffers,
2 textures for each index buffer ( texture + alphamap ).

I have a loop where I render all chunks ( now are 6 )

there are few places where a bottleneck can to be....
Anyway I''ll search them...

thanks for all

Share this post


Link to post
Share on other sites
quote:
Original post by BlueChip
Is not easy to find bottlenecks...


Use a profiler.

quote:

because I don''t use LOD system, or culling system...

In my terrain there is only the brutal force ...

Each chunk has:
1 vertex buffer with 64x64 verticies,
3 index buffers,
2 textures for each index buffer ( texture + alphamap ).

I have a loop where I render all chunks ( now are 6 )

there are few places where a bottleneck can to be....


Woah, not so fast with conclusions. You''re rendering 6 chunks per frame, 8192 triangles per chunk. That''s not even 50,000 faces per frame, assuming brute force. And you say you''re getting 50fps with a R9600pro and a 3200+ ? Let me tell you one thing: there is a very big performance problem in your code. You could get that frame rate on a Voodoo3, with a face count like that. You should get 10 to 50 times that fps on your system.

My guess: you are filling your vertex or index buffers every frame. Classic. If not, post your code (the important parts).

Share this post


Link to post
Share on other sites
I used ps 2.0 to do 4 splat textures at once, each one with it''s own detail map . I never profiled to see how fast it was though, but I''m positive it was fill rate limited.

Share this post


Link to post
Share on other sites