mikkokko/csldr

About renderer

Closed this issue · 4 comments

Hey mikkokko, I have tested the new feature (renderer) and I have some questions and reports about it.

Performance tests

Tested on Linux client, GPU: RTX 3070Ti
Studio info:

OpenGL version: 4.6.0 NVIDIA 530.41.03
GL_ARB_uniform_buffer_object: available
Fast path: available
GPU skinning: enabled

I found a player model that has ~54k polygons, set it to 30 bots and looked at the fps.

Total number of e-poly in these screenshots: 1 624 526

studio_fastpath 0: 14 fps

20230428085707_1

studio_fastpath 1: 200+ fps

20230428085721_1

It works perfectly for hi-poly models!
BUT.

Issues

  1. As you said in readme, "some parts are too dark and others too light". Can this be fixed?
  2. Also "Elights are not handled". (I have elight for a flashlight on my server, I would appreciate ir if this could be fixed)
  3. pev_renderfx kRenderTransAlpha doesn't work. This is bad because many servers use it to make players invisible.
  4. kRenderGlow + kRenderFxGlowShell does not work - game crashes instantly. This is just as bad because many servers use kRenderFxGlowShell. I think even more than kRenderTransAlpha.
  5. I did some playtests on the servers. Sometimes the game just randomly crashes. Maybe there was an entity with kRenderFxGlowShell appears at these moments, but I haven't seen it, I don't know. Sometimes it happened right after connecting to the server.
  6. r_speed doesn't show epoly, but I was expecting that.

Questions

Custom rendermodes are not implemented (haven't bothered, rarely seen in-game like chrome)

  1. What is custom rendermodes? Did you mean pev_rendermode?

Rendering of hulls, bboxes or bones is not supported

  1. What exactly does this mean? I haven't seen them rendered in a normal game.

Chrome rendering is wrong

  1. What is this? Did you mean a "chrome" effect on view model? (on screenshot studio_fastpath is 0)

20230428102416_1

If so, it seems to work with studio_fastpath 1.

Summarizing

The new feature works, but needs some fine-tuning for playing.
And...
The topic I wanted to raise the fact that the performance of the game unfortunately can not be raised only the new rendering models. This is cool to play on fully modded servers, such as Zombie Plague (+ cso mod) or CS:GO mod. They often use models with a lot of polygons. But. The game also requires a new world renderer. Can you do that?
World polygons as well as models, with the current rendering greatly reduce the performance of the game.
For eg: on my server (without hi-poly models) the new renderer gives only +10-30 fps, no more... And I mean at a total of 500+ fps, so it's not even 10%
Another example: I have ~1100 fps with 8 wpoly and ~600 fps with 1078 epoly. And this is still on an empty listenserver with no models! And with my GPU. Imagine what happens on weak PCs on live servers.

Hi, thanks for the detailed report. I've pushed a commit that fixes some of the issues you mentioned.

As you said in readme, "some parts are too dark and others too light". Can this be fixed?

This should be fixed now that the lighting is gamma corrected.

Also "Elights are not handled". (I have elight for a flashlight on my server, I would appreciate ir if this could be fixed)

Should be possible to fix.

pev_renderfx kRenderTransAlpha doesn't work. This is bad because many servers use it to make players invisible.

This is fixed now.

kRenderGlow + kRenderFxGlowShell does not work - game crashes instantly. This is just as bad because many servers use kRenderFxGlowShell. I think even more than kRenderTransAlpha.

Fixed, although glowshell rendering is inaccurate. I'm using the default normals of the models which will cause issues especially on models that have hard edges.

I did some playtests on the servers. Sometimes the game just randomly crashes. Maybe there was an entity with kRenderFxGlowShell appears at these moments, but I haven't seen it, I don't know. Sometimes it happened right after connecting to the server.

I guess this should be fixed now? Can't immediately notice anything else in the code that could cause crashes.

r_speed doesn't show epoly, but I was expecting that.

Can't fix this since there's no portable way to access the epoly counter from the client.dll.

What is custom rendermodes? Did you mean pev_rendermode?

Yes, entity specific rendering modifiers like rendermode, renderfx, renderamt etc.

What exactly does this mean? I haven't seen them rendered in a normal game.

r_drawentities values greater than 0 can be used to render these. I don't think they work in multiplayer, though.

What is this? Did you mean a "chrome" effect on view model? (on screenshot studio_fastpath is 0)

Yes. Chrome rendering was inaccurate, even though it seemed fine on most models.

The game also requires a new world renderer. Can you do that?

Eventually I would like to write a custom world renderer, though writing a fully featured one within client.dll would be quite a lot of work.

I tested the updated version - yes, now there are no crashes and all the rendering effects work. And the brightness of the models is fine.

But there is one small defect with kRenderFxGlowShell effect, when it is applied to some object, some other objects become semi-transparent for some reason.

Examples:

20230504204442_1

20230504204445_1

However, it happens as if from a certain angle of view:

(no bug)

20230504204647_1

20230504204729_1

20230504204731_1

20230504204828_1

20230504204832_1

(p_* model becomes transparent)

20230504205227_1

When the glow effect is applied to an entity, the bug happens to other entities, but not to players. When the glow effect is applied to a player, the bug appears on players, but not on other entities:

20230504205315_1

20230504205331_1

This should be fixed in 19bf2d5. Elights are also implemented now.

Everything seems to be working fine now. I'll let you know if I find any more flaws.

I also have to say that I get a warning when I compile:
pic

And

Eventually I would like to write a custom world renderer, though writing a fully featured one within client.dll would be quite a lot of work.

It will be great if you can make a new world rendering. I could help with playtests.