UPBGE / upbge

UPBGE, the best integrated game engine in Blender
https://upbge.org
Other
1.43k stars 180 forks source link

Realtime cycles not going above one sample in standalone player. #1820

Closed e2002e closed 1 year ago

e2002e commented 1 year ago

Hello, I've been able to render a scene with cycles and OptiX that is optimized enough to make a game. Even with mesh transforming modifier and heavy use of reflection / refraction, it looks good in the viewport (able to render multiple samples in a frame and denoise). The standalone player though doesn't work because it seems to start over the whole rendering procedure for each frame and is unable to render more than a sample, showing a very pixelized image. Is there an option that could solve this issue ?

youle31 commented 1 year ago

I can't really investigate on this for now, maybe at autumn (i haven't a graphic card for the summer). I never tested cycles on blenderplayer, we focused more on eevee support.

If you want, on your side, as you seem to code, you can try to compare blender and blenderplayer pipelines (gpg_ghost.cpp), see if there are missing definitions (WITH_CYCLES_DEVICE_OPTIX or things like that in ge_player library (source/gameengine/GamePlayer folder))....

You can also share a simple test file with the settings you use to have several samples per frame rendered.

And which code were you using to switch of engine when you were launching blenderplayer (as by default, it is running eevee)

e2002e commented 1 year ago

@youle31 thanks for the answer. I am going to do more tests with cycles. The issue in the difference from viewport to standalone seems to not exist after all (maybe it was a driver or system issue). Now it seems a bit difficult to use cycles for realtime rendering when using reflective / refractive materials. The pipeline seems to render these afterward and requires going above one sample which is not possible on a laptop 3050 rtx. As for rough materials it looks great. Maybe latter on then.