tobspr / RenderPipeline

Physically Based Shading and Deferred Rendering for the Panda3D game engine
https://github.com/tobspr/RenderPipeline/wiki
Other
967 stars 133 forks source link

Poor performance #77

Open RodrigoMedeirosRS opened 7 years ago

RodrigoMedeirosRS commented 7 years ago

Hello people!

At the begin of this year i made a complete upgrade on my devolpment hardware, now my specs are:

Processor: AMD APU 7890K Ram: 16Gb hyberX 1866mhz in dual channel Video: R7 250 - 2GB OS: Windows 10 64bits SSD 120gb hiperX 5gb /seg

With this config i can running the all Unreal 4 demos in Cinematic Quality but, i can't run the RP into HD resolutions (1280 x 720), when i try it i se many many lags :\

tobspr commented 7 years ago

Hi,

can you run pstats and see which parts of the pipeline are running slow?

RodrigoMedeirosRS commented 7 years ago

Spstatus + Sys Monitor

1280 x 720 1280

800 x 600 800

In both cases, i have many, many lags when i move the camera, but, the frame rate never drops.

rdb commented 7 years ago

It would be very helpful to see the pstats charts. If you have the pstats process running, press 1 in the pipeline to enable it.

RodrigoMedeirosRS commented 7 years ago

Sorry, i confuse the pstats and stats gui.

Here is the PStats:

1280 x 720 ss1

800 x 600 ss

tobspr commented 7 years ago

Could you open the gpu graph and check which parts take the most time?

rdb commented 7 years ago

Also, keep in mind you can double-click the labels on the left to get a more detailed subdivision of that category of the graph. For example, clicking the "Draw" label will open up a new chart showing how the draw time is divided up.

RodrigoMedeirosRS commented 7 years ago

Note: My pc use's a APU technology - https://www.youtube.com/watch?v=ER_u3yLccBU

So i have made a print for every graph option i will post the most critical first:

1280 x 720 * AMD(TM)R7 Graphics: 1280x720 - amd tm r7 graphics

* Draw 1280x720 - draw

* Draw -> Primitive 1280x720 - draw - primitive

* App 1280x720 - app

* Cull 1280x720 - cull

* Time 1280x720 - time

* Wait 1280x720 - wait

800 x 600 * AMD(TM)R7 Graphics: 800x600 - amd tm r7 graphics

* Draw 800x600 - draw

* Draw -> Primitive 800x600 - draw - primitive

* App 800x600 - app

* Cull 800x600 - cull

* Time 800x600 - time

* Wait 800x600 - wait

tobspr commented 7 years ago

Thats weird, it looks like everything is too slow. Are you sure you are not running it on an integrated gpu or so?

rdb commented 7 years ago

Yes, an APU has integrated graphics, so make sure that it has been switched to use the external graphics card.

Are these the CPU charts you're showing or the GPU charts? (The GPU charts are available under the "AMD Radeon… > Frame" menu.

Which version of Panda do you have?

Is there any improvement from adding 'gl-version 3 2' in the pipeline Config.prc?

RodrigoMedeirosRS commented 7 years ago

Yes, i am using the integrated Graphics, my integrated graphic is a Readeon R7 250 with 2gb vram and 512 stream processors, my integrated Graphics are running the Unreal 4 into cinematic quality and CryEngine 5 in best no 4k quality. The external card works only into the Crossfire, but the AMD crossfire crashe's all OpenGL applications, and work only into the DX11 applications.

The AMD(TM)R7 Graphics charts are showing my integrated card.

default-writer commented 3 years ago

I have 1080 ti, and funny part that in small window, it is 400fps+ but in 4k, any scene of almost any complex is no more than 40 fps, seems that python doing some weird staff with paints windows background, cause it is bitbltm the more sureface are, the more ms is spend on purpouseless repaint of transparent background, anyway this is a window and borderless window preoblem on any of the samples. It looks like this is a problem with Pandas3d itself, can you take a look and fix it? @tobspr

rdb commented 3 years ago

@funcelot that has nothing to do with Python or Panda3D, but it's because the RenderPipeline is using deferred rendering. That means most of the shaders run in postprocessing, once per fragment, and so any doubling in resolution will result in a quadrupling of the render time of the entire postprocessing pipeline, which adds up quickly.

4K has a lot of pixels to render. Most games that use deferred rendering do not run well in 4K, and typically render downscaled and then upscale in a postprocessing pass.

default-writer commented 3 years ago

@funcelot that has nothing to do with Python or Panda3D, but it's because the RenderPipeline is using deferred rendering. That means most of the shaders run in postprocessing, once per fragment, and so any doubling in resolution will result in a quadrupling of the render time of the entire postprocessing pipeline, which adds up quickly.

4K has a lot of pixels to render. Most games that use deferred rendering do not run well in 4K, and typically render downscaled and then upscale in a postprocessing pass.

Is that the same technique i seen in Cyberpunk2077 wher image seems crispy and make somewhat more detaild in one sec or so? Got your point, thanx

default-writer commented 3 years ago

@funcelot that has nothing to do with Python or Panda3D, but it's because the RenderPipeline is using deferred rendering. That means most of the shaders run in postprocessing, once per fragment, and so any doubling in resolution will result in a quadrupling of the render time of the entire postprocessing pipeline, which adds up quickly.

4K has a lot of pixels to render. Most games that use deferred rendering do not run well in 4K, and typically render downscaled and then upscale in a postprocessing pass.

I saw down scaling & posptrocess upscaling in Horizon Zero Dawn, where i play in 4K, but can postprocess in 1080p, using 50% or 25% scale

default-writer commented 3 years ago

Can you provide upscaling / downscaling example using you pipline renderer @tobspr ? That would be really aswesome to see 120 fps on 4K, indeed :)

tobspr commented 3 years ago

There are multiple ways of doing that, IIRC the pipeline supports it natively though, you can set resolution_scale in the config: https://github.com/tobspr/RenderPipeline/blob/master/config/pipeline.yaml#L26

To e.g. 0.75, the pipeline will then render at 75% resolution and scale up