Gestion du niveau de qualité du rendu EEVEE

This commit is contained in:
Philippe Roy 2023-07-11 15:49:37 +02:00
parent e913735411
commit 1bc1c22d02
8 changed files with 96 additions and 32 deletions

Binary file not shown.

Binary file not shown.

View File

@ -130,14 +130,8 @@ def cmd_init():
# Configuration de l'écran
bge.render.setWindowSize(int(twin_config[0][0].text),int(twin_config[0][1].text))
quality_eevee=('NOSMAA', 'LOW', 'MEDIUM','HIGH','ULTRA')
scene.objects['About']['quality'] = int(twin_config[0][2].text)
if quality_eevee[scene.objects['About']['quality']] == 'NOSMAA':
eevee.smaa_quality= 'LOW'
eevee.use_eevee_smaa = False
else:
eevee.use_eevee_smaa = True
eevee.smaa_quality= quality_eevee[scene.objects['About']['quality']]
twin_about.quality_apply(scene.objects['About']['quality'], True)
# Ajout du Hud
# scene.active_camera = scene.objects["Camera"]

View File

@ -89,7 +89,6 @@ def open():
# Liens
scene.objects['About_link-git'].color= color_link
scene.objects['About_link-git']['Text'] = "Dépôt des sources" # Pas de ô dans Blender
scene.objects['About_link-gpl'].color= color_link
scene.objects['About_link-upbge'].color= color_link
scene.objects['About'].setVisible(True,True)
@ -294,18 +293,8 @@ def screen_down(cont):
def quality_up(cont):
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
quality_txt=("Inconvenant", "Basse", "Moyenne", "Haute", "Épique")
quality_eevee=('NOSMAA', 'LOW', 'MEDIUM','HIGH','ULTRA')
scene.objects['About']['quality'] +=1
scene.objects['About_quality']['Text']= "Qualité : "+quality_txt[scene.objects['About']['quality']]
if quality_eevee[scene.objects['About']['quality']] == 'NOSMAA':
eevee.smaa_quality= 'LOW'
eevee.use_eevee_smaa = False
else:
eevee.use_eevee_smaa = True
# print (sys.platform)
if sys.platform=="linux": # Plantage sur Windows
eevee.smaa_quality= quality_eevee[scene.objects['About']['quality']]
quality_apply(scene.objects['About']['quality'])
# Boutons < et >
if scene.objects['About']['quality']==4:
@ -317,17 +306,8 @@ def quality_up(cont):
def quality_down(cont):
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
quality_txt=("Inconvenant", "Basse", "Moyenne", "Haute", "Épique")
quality_eevee=('NOSMAA', 'LOW', 'MEDIUM','HIGH','ULTRA')
scene.objects['About']['quality'] -=1
scene.objects['About_quality']['Text']= "Qualité : "+quality_txt[scene.objects['About']['quality']]
if quality_eevee[scene.objects['About']['quality']] == 'NOSMAA':
eevee.smaa_quality= 'LOW'
eevee.use_eevee_smaa = False
else:
eevee.use_eevee_smaa = True
if sys.platform=="Linux": # Plantage sur Windows
eevee.smaa_quality= quality_eevee[scene.objects['About']['quality']]
quality_apply(scene.objects['About']['quality'])
# Boutons < et >
if scene.objects['About']['quality']==0:
@ -336,3 +316,93 @@ def quality_down(cont):
if scene.objects['About']['quality']==3:
scene.objects['About_quality-up'].setVisible(True,True)
scene.objects['About_quality-up-colbox'].restorePhysics()
##
# Qualité du rendu EEVEE de 0 à 4
##
def quality_apply(quality, start_flag=False):
# Texte du About
quality_txt=("Inconvenant", "Basse", "Moyenne", "Haute", "Épique")
scene.objects['About_quality']['Text']= "Qualité : "+quality_txt[quality]
if start_flag== False and sys.platform!="linux": # Plantage sur Windows -> redémarrage après changement
return
# Inconvenant
if quality== 0:
# eevee.use_eevee_smaa = False # Option obsolète depuis la version UPBGE 0.36
eevee.use_taa_reprojection = False
eevee.use_ssr = False # Screen space reflection
eevee.use_gtao = False # Ambient occlusion
eevee.taa_render_samples = 1
eevee.taa_samples = 1
eevee.use_volumetric_lights = False
eevee.use_volumetric_shadows = False
eevee.shadow_cascade_size='64'
eevee.shadow_cube_size='64'
# Basse
if quality== 1:
# eevee.use_eevee_smaa = True # Option obsolète depuis la version UPBGE 0.36
eevee.use_taa_reprojection = True
# eevee.smaa_quality= 'LOW' # Option obsolète depuis la version UPBGE 0.36
eevee.use_ssr = True # Screen space reflection
eevee.use_ssr_refraction = False # Screen space refractions
eevee.use_ssr_halfres = True
eevee.use_gtao = False
eevee.taa_render_samples = 32
eevee.taa_samples = 8
eevee.use_volumetric_lights = True
eevee.use_volumetric_shadows = False
eevee.shadow_cascade_size='1024'
eevee.shadow_cube_size='512'
# Moyenne
if quality== 2:
# eevee.use_eevee_smaa = True # Option obsolète depuis la version UPBGE 0.36
eevee.use_taa_reprojection = True
# eevee.smaa_quality= 'MEDIUM' # Option obsolète depuis la version UPBGE 0.36
eevee.use_ssr = True # Screen space reflection
eevee.use_ssr_refraction = True # Screen space refractions
eevee.use_ssr_halfres = True
eevee.use_gtao = False
eevee.taa_render_samples = 64
eevee.taa_samples = 16
eevee.use_volumetric_lights = True
eevee.use_volumetric_shadows = False
eevee.shadow_cascade_size='1024'
eevee.shadow_cube_size='512'
# Haute
if quality== 3:
# eevee.use_eevee_smaa = True # Option obsolète depuis la version UPBGE 0.36
eevee.use_taa_reprojection = True
# eevee.smaa_quality= 'HIGH' # Option obsolète depuis la version UPBGE 0.36
eevee.use_ssr = True
eevee.use_ssr_refraction = True
eevee.use_ssr_halfres = False
eevee.use_gtao = False
eevee.taa_render_samples = 64
eevee.taa_samples = 16
eevee.use_volumetric_lights = True
eevee.use_volumetric_shadows = False
eevee.shadow_cascade_size='1024'
eevee.shadow_cube_size='512'
# Épique
if quality== 4:
# eevee.use_eevee_smaa = True # Option obsolète depuis la version UPBGE 0.36
eevee.use_taa_reprojection = True
# eevee.smaa_quality= 'ULTRA' # Option obsolète depuis la version UPBGE 0.36
eevee.use_ssr = True
eevee.use_ssr_refraction = True
eevee.use_ssr_halfres = False
eevee.use_gtao = True
eevee.taa_render_samples = 64
eevee.taa_samples = 16
eevee.use_volumetric_lights = True
eevee.use_volumetric_shadows = True
eevee.shadow_cascade_size='4096'
eevee.shadow_cube_size='4096'

View File

@ -1,8 +1,8 @@
<data>
<screen>
<width>1071</width>
<height>602</height>
<quality>1</quality>
<width>1568</width>
<height>882</height>
<quality>4</quality>
</screen>
<plot>
<config>True</config>

Binary file not shown.