mirror of
https://forge.apps.education.fr/blender-edutech/lecteur-3d-cinematique.git
synced 2024-01-27 09:43:12 +01:00
Gestion du niveau de qualité du rendu EEVEE
This commit is contained in:
parent
799643d5ee
commit
107c9e1208
Binary file not shown.
1
baton_colle/cine_config-bak.xml
Symbolic link
1
baton_colle/cine_config-bak.xml
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/lecteur-3d-cinematique/cine_config-bak.xml
|
34
cine.py
34
cine.py
@ -22,13 +22,11 @@ import cine_about # About
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
# UPBGE scene
|
# UPBGE scene
|
||||||
eevee = bpy.context.scene.eevee
|
|
||||||
scene = bge.logic.getCurrentScene()
|
scene = bge.logic.getCurrentScene()
|
||||||
# print("Objets de la scene : ", scene.objects)
|
# print("Objets de la scene : ", scene.objects)
|
||||||
|
|
||||||
# Config file
|
# Config file
|
||||||
cine_config = ET.parse('cine_config.xml')
|
cine_config = ET.parse('cine_config.xml').getroot()
|
||||||
cine_config_tree = cine_config.getroot()
|
|
||||||
|
|
||||||
# Couleurs
|
# Couleurs
|
||||||
color_cmd = [0.8, 0.8, 0.8, 1] # Blanc
|
color_cmd = [0.8, 0.8, 0.8, 1] # Blanc
|
||||||
@ -57,9 +55,10 @@ def keyboard(cont):
|
|||||||
# Maj du fichier de config (screen size : data/config/screen/width-> [0][0].text)
|
# Maj du fichier de config (screen size : data/config/screen/width-> [0][0].text)
|
||||||
screen_width = bge.render.getWindowWidth()
|
screen_width = bge.render.getWindowWidth()
|
||||||
screen_height = bge.render.getWindowHeight()
|
screen_height = bge.render.getWindowHeight()
|
||||||
cine_config_tree[0][0].text=str(screen_width)
|
cine_config[0][0].text=str(screen_width)
|
||||||
cine_config_tree[0][1].text=str(screen_height)
|
cine_config[0][1].text=str(screen_height)
|
||||||
buffer_xml = ET.tostring(cine_config_tree)
|
cine_config[0][2].text=str(scene.objects['About']['quality'])
|
||||||
|
buffer_xml = ET.tostring(cine_config)
|
||||||
with open("cine_config.xml", "wb") as f:
|
with open("cine_config.xml", "wb") as f:
|
||||||
f.write(buffer_xml)
|
f.write(buffer_xml)
|
||||||
|
|
||||||
@ -97,10 +96,12 @@ def keyboard(cont):
|
|||||||
if scene.objects['Mecanism']['anim'] == True:
|
if scene.objects['Mecanism']['anim'] == True:
|
||||||
anim_pause()
|
anim_pause()
|
||||||
scene.objects['Pause'].setVisible(False,False)
|
scene.objects['Pause'].setVisible(False,False)
|
||||||
|
scene.objects['Pause-Hl'].setVisible(False,False)
|
||||||
scene.objects['Play'].setVisible(True,False)
|
scene.objects['Play'].setVisible(True,False)
|
||||||
else:
|
else:
|
||||||
anim_play()
|
anim_play()
|
||||||
scene.objects['Play'].setVisible(False,False)
|
scene.objects['Play'].setVisible(False,False)
|
||||||
|
scene.objects['Play-Hl'].setVisible(False,False)
|
||||||
scene.objects['Pause'].setVisible(True,False)
|
scene.objects['Pause'].setVisible(True,False)
|
||||||
|
|
||||||
# Touche H -> Cacher l'objet (hide)
|
# Touche H -> Cacher l'objet (hide)
|
||||||
@ -134,8 +135,13 @@ def keyboard(cont):
|
|||||||
##
|
##
|
||||||
|
|
||||||
def cmd_init():
|
def cmd_init():
|
||||||
# Fichier de config (screen size : data/config/screen/width-> [0][0].text, height-> [0][1].text)
|
|
||||||
bge.render.setWindowSize(int(cine_config_tree[0][0].text),int(cine_config_tree[0][1].text))
|
# Configuration de l'écran
|
||||||
|
bge.render.setWindowSize(int(cine_config[0][0].text),int(cine_config[0][1].text))
|
||||||
|
scene.objects['About']['quality'] = int(cine_config[0][2].text)
|
||||||
|
cine_about.quality_apply(scene.objects['About']['quality'], True)
|
||||||
|
|
||||||
|
# UI : Commands
|
||||||
scene.objects['Play-Hl'].setVisible(False,False)
|
scene.objects['Play-Hl'].setVisible(False,False)
|
||||||
scene.objects['Pause-Hl'].setVisible(False,False)
|
scene.objects['Pause-Hl'].setVisible(False,False)
|
||||||
scene.objects['Reset-colors-Hl'].setVisible(False,False)
|
scene.objects['Reset-colors-Hl'].setVisible(False,False)
|
||||||
@ -355,10 +361,6 @@ def circle (center, radius, color):
|
|||||||
# def manip_init(cont):
|
# def manip_init(cont):
|
||||||
def manip_init():
|
def manip_init():
|
||||||
|
|
||||||
# Configuration du moteur de rendu
|
|
||||||
# eevee.use_eevee_smaa = True # Option obsolète depuis la version UPBGE 0.36
|
|
||||||
eevee.use_taa_reprojection = True
|
|
||||||
|
|
||||||
# Fenêtres
|
# Fenêtres
|
||||||
scene.objects['About'].setVisible(False,True)
|
scene.objects['About'].setVisible(False,True)
|
||||||
scene.objects['Doc'].setVisible(False,True)
|
scene.objects['Doc'].setVisible(False,True)
|
||||||
@ -705,12 +707,12 @@ def object_hl(cont):
|
|||||||
if hitObject is not None and hitObject.visible:
|
if hitObject is not None and hitObject.visible:
|
||||||
scene.objects['Nomenclature-'+str(scene.objects['Mecanism']['objects_dict'][hitObject.name][0])].setVisible(False,False)
|
scene.objects['Nomenclature-'+str(scene.objects['Mecanism']['objects_dict'][hitObject.name][0])].setVisible(False,False)
|
||||||
scene.objects['Nomenclature-'+str(scene.objects['Mecanism']['objects_dict'][hitObject.name][0])+'-Hl'].setVisible(True,False)
|
scene.objects['Nomenclature-'+str(scene.objects['Mecanism']['objects_dict'][hitObject.name][0])+'-Hl'].setVisible(True,False)
|
||||||
# scene.objects['Nomenclature-'+str(scene.objects['Mecanism']['objects_dict'][hitObject.name][0])+'-Ot2'].setVisible(True,False)
|
scene.objects['Nomenclature-'+str(scene.objects['Mecanism']['objects_dict'][hitObject.name][0])+'-Ot2'].setVisible(True,False)
|
||||||
if cont.sensors['MO'].status == JUST_RELEASED:
|
if cont.sensors['MO'].status == JUST_RELEASED:
|
||||||
for objet in scene.objects['Mecanism']['objects'] :
|
for objet in scene.objects['Mecanism']['objects'] :
|
||||||
scene.objects['Nomenclature-'+str(scene.objects['Mecanism']['objects_dict'][objet][0])].setVisible(True,False)
|
scene.objects['Nomenclature-'+str(scene.objects['Mecanism']['objects_dict'][objet][0])].setVisible(True,False)
|
||||||
scene.objects['Nomenclature-'+str(scene.objects['Mecanism']['objects_dict'][objet][0])+'-Hl'].setVisible(False,False)
|
scene.objects['Nomenclature-'+str(scene.objects['Mecanism']['objects_dict'][objet][0])+'-Hl'].setVisible(False,False)
|
||||||
# scene.objects['Nomenclature-'+str(scene.objects['Mecanism']['objects_dict'][objet][0])+'-Ot2'].setVisible(False,False)
|
scene.objects['Nomenclature-'+str(scene.objects['Mecanism']['objects_dict'][objet][0])+'-Ot2'].setVisible(False,False)
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Nomenclature
|
# Nomenclature
|
||||||
@ -755,11 +757,11 @@ def nom_hl(cont):
|
|||||||
if cont.sensors['MO'].status == JUST_ACTIVATED and scene.objects['Mecanism']['manip_mode']==0:
|
if cont.sensors['MO'].status == JUST_ACTIVATED and scene.objects['Mecanism']['manip_mode']==0:
|
||||||
obj.setVisible(False,False)
|
obj.setVisible(False,False)
|
||||||
scene.objects[name+'-Hl'].setVisible(True,False)
|
scene.objects[name+'-Hl'].setVisible(True,False)
|
||||||
# scene.objects[name+'-Ot2'].setVisible(True,False)
|
scene.objects[name+'-Ot2'].setVisible(True,False)
|
||||||
if cont.sensors['MO'].status == JUST_RELEASED and scene.objects['Mecanism']['manip_mode']==0:
|
if cont.sensors['MO'].status == JUST_RELEASED and scene.objects['Mecanism']['manip_mode']==0:
|
||||||
obj.setVisible(True,False)
|
obj.setVisible(True,False)
|
||||||
scene.objects[name+'-Hl'].setVisible(False,False)
|
scene.objects[name+'-Hl'].setVisible(False,False)
|
||||||
# scene.objects[name+'-Ot2'].setVisible(False,False)
|
scene.objects[name+'-Ot2'].setVisible(False,False)
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Repères
|
# Repères
|
||||||
|
254
cine_about.py
254
cine_about.py
@ -1,6 +1,7 @@
|
|||||||
import bge # Bibliothèque Blender Game Engine (UPBGE)
|
import bge # Bibliothèque Blender Game Engine (UPBGE)
|
||||||
|
import bpy # Blender
|
||||||
|
import sys
|
||||||
import webbrowser
|
import webbrowser
|
||||||
import numpy as np
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# cine_about.py
|
# cine_about.py
|
||||||
@ -14,11 +15,14 @@ import numpy as np
|
|||||||
|
|
||||||
# UPBGE scene
|
# UPBGE scene
|
||||||
scene = bge.logic.getCurrentScene()
|
scene = bge.logic.getCurrentScene()
|
||||||
|
eevee = bpy.context.scene.eevee
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
color_link = [0.051, 0.270, 0.279,1] # Turquoise
|
color_link = (0.198, 0.109, 0.8, 1) # Violet
|
||||||
# color_link = [0.024, 0.006, 0.8, 1] # Bleu
|
color_link_hl = (0.8, 0.005, 0.315, 1) # Magenta
|
||||||
color_link_hl = [0.8, 0.005, 0.315, 1] # Magenta
|
# color_link = (0.051, 0.270, 0.279,1) # Turquoise
|
||||||
|
# color_link = (0.024, 0.006, 0.8, 1) # Bleu
|
||||||
|
# color_link = (0.8, 0.005, 0.315, 1) # Magenta
|
||||||
|
|
||||||
# UPBGE constants
|
# UPBGE constants
|
||||||
JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED
|
JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED
|
||||||
@ -26,6 +30,21 @@ JUST_RELEASED = bge.logic.KX_INPUT_JUST_RELEASED
|
|||||||
ACTIVATE = bge.logic.KX_INPUT_ACTIVE
|
ACTIVATE = bge.logic.KX_INPUT_ACTIVE
|
||||||
# JUST_DEACTIVATED = bge.logic.KX_SENSOR_JUST_DEACTIVATED
|
# JUST_DEACTIVATED = bge.logic.KX_SENSOR_JUST_DEACTIVATED
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Crédits
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
credits_description = {
|
||||||
|
'Blender' : ["Blender","Plateforme de modélisation et d\"animation 3D","https://blender.org", "GNU GPL"],
|
||||||
|
'UPBGE' : ["UPBGE","Moteur de jeu 3D","https://upbge.org", "GNU GPL"],
|
||||||
|
'Python' : ["Python","Langage de programmation","https://python.org", "PSFL"],
|
||||||
|
'Kenney' : ["Kenney","Icônes","https://www.kenney.nl/","CC0 1.0"],
|
||||||
|
'EspressoDolce' : ["Espresso Dolce","Police de caractères","https://www.dafont.com/fr/espresso-dolce.font", "OFL"]}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Interface
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
##
|
##
|
||||||
# Ouverture
|
# Ouverture
|
||||||
##
|
##
|
||||||
@ -33,17 +52,32 @@ ACTIVATE = bge.logic.KX_INPUT_ACTIVE
|
|||||||
def open():
|
def open():
|
||||||
scene.active_camera = scene.objects["Camera-About"]
|
scene.active_camera = scene.objects["Camera-About"]
|
||||||
scene.objects['About_close'].color= color_link
|
scene.objects['About_close'].color= color_link
|
||||||
|
scene.objects['About_credits'].color= color_link
|
||||||
|
|
||||||
|
# Mémorisation de la position des pages
|
||||||
|
scene.objects["About"]['init_lx']=scene.objects["About"].worldPosition.x
|
||||||
|
scene.objects["About"]['init_ly']=scene.objects["About"].worldPosition.y
|
||||||
|
scene.objects["About"]['init_lz']=scene.objects["About"].worldPosition.z
|
||||||
|
scene.objects["Credits"]['init_lx']=scene.objects["Credits"].worldPosition.x
|
||||||
|
scene.objects["Credits"]['init_ly']=scene.objects["Credits"].worldPosition.y
|
||||||
|
scene.objects["Credits"]['init_lz']=scene.objects["Credits"].worldPosition.z
|
||||||
|
|
||||||
|
# Configuration
|
||||||
scene.objects['About_screen-up'].color= color_link
|
scene.objects['About_screen-up'].color= color_link
|
||||||
scene.objects['About_screen-down'].color= color_link
|
scene.objects['About_screen-down'].color= color_link
|
||||||
scene.objects['About_screen']['Text']= "Taille écran : "+str(bge.render.getWindowWidth()) +" x "+str(bge.render.getWindowHeight())
|
scene.objects['About_screen']['Text']= "Taille écran : "+str(bge.render.getWindowWidth()) +" x "+str(bge.render.getWindowHeight())
|
||||||
|
scene.objects['About_quality-up'].color= color_link
|
||||||
|
scene.objects['About_quality-down'].color= color_link
|
||||||
|
quality_txt=("Inconvenant", "Basse", "Moyenne", "Haute", "Épique")
|
||||||
|
scene.objects['About_quality']['Text']= "Qualité : "+quality_txt[scene.objects['About']['quality']]
|
||||||
|
|
||||||
|
# Liens
|
||||||
scene.objects['About_link-git'].color= color_link
|
scene.objects['About_link-git'].color= color_link
|
||||||
scene.objects['About_link-gpl'].color= color_link
|
scene.objects['About_link-gpl'].color= color_link
|
||||||
scene.objects['About_link-upbge'].color= color_link
|
scene.objects['About_link-upbge'].color= color_link
|
||||||
|
|
||||||
scene.objects['About'].setVisible(True,True)
|
scene.objects['About'].setVisible(True,True)
|
||||||
|
|
||||||
# Boutons < et > ("640x360", "960x540", "1280x720", "1920x1080")
|
# Taille de l'écran : Boutons < et > ("640x360", "960x540", "1280x720", "1920x1080")
|
||||||
if bge.render.getWindowWidth() <=640:
|
if bge.render.getWindowWidth() <=640:
|
||||||
scene.objects['About_screen-down'].setVisible(False,True)
|
scene.objects['About_screen-down'].setVisible(False,True)
|
||||||
scene.objects['About_screen-down-colbox'].suspendPhysics (True)
|
scene.objects['About_screen-down-colbox'].suspendPhysics (True)
|
||||||
@ -57,6 +91,24 @@ def open():
|
|||||||
scene.objects['About_screen-up'].setVisible(True,True)
|
scene.objects['About_screen-up'].setVisible(True,True)
|
||||||
scene.objects['About_screen-up-colbox'].restorePhysics()
|
scene.objects['About_screen-up-colbox'].restorePhysics()
|
||||||
|
|
||||||
|
# Qualité du rendu : Boutons < et >
|
||||||
|
if scene.objects['About']['quality']==4:
|
||||||
|
scene.objects['About_quality-up'].setVisible(False,True)
|
||||||
|
scene.objects['About_quality-up-colbox'].suspendPhysics (True)
|
||||||
|
else:
|
||||||
|
scene.objects['About_quality-up'].setVisible(True,True)
|
||||||
|
scene.objects['About_quality-up-colbox'].restorePhysics()
|
||||||
|
if scene.objects['About']['quality']==0:
|
||||||
|
scene.objects['About_quality-down'].setVisible(False,True)
|
||||||
|
scene.objects['About_quality-down-colbox'].suspendPhysics (True)
|
||||||
|
else:
|
||||||
|
scene.objects['About_quality-down'].setVisible(True,True)
|
||||||
|
scene.objects['About_quality-down-colbox'].restorePhysics()
|
||||||
|
|
||||||
|
##
|
||||||
|
# Fermer
|
||||||
|
##
|
||||||
|
|
||||||
def close(cont):
|
def close(cont):
|
||||||
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
||||||
if scene.objects['About']['anim'] == True:
|
if scene.objects['About']['anim'] == True:
|
||||||
@ -105,14 +157,68 @@ def link(cont):
|
|||||||
'About_link-upbge' : 'https://www.upbge.org'}
|
'About_link-upbge' : 'https://www.upbge.org'}
|
||||||
webbrowser.open(link [name])
|
webbrowser.open(link [name])
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Crédits
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
def credits(cont):
|
||||||
|
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
||||||
|
|
||||||
|
# Afficher la page Crédits
|
||||||
|
scene.objects["Credits"].worldPosition.x = scene.objects["About"]['init_lx']
|
||||||
|
scene.objects["Credits"].worldPosition.y = scene.objects["About"]['init_ly']
|
||||||
|
scene.objects["Credits"].worldPosition.z = scene.objects["About"]['init_lz']
|
||||||
|
scene.objects["About"].worldPosition.x = scene.objects["Credits"]['init_lx']
|
||||||
|
scene.objects["About"].worldPosition.y = scene.objects["Credits"]['init_ly']
|
||||||
|
scene.objects["About"].worldPosition.z = scene.objects["Credits"]['init_lz']
|
||||||
|
scene.objects['About'].setVisible(False,True)
|
||||||
|
scene.objects['Credits'].setVisible(True,True)
|
||||||
|
scene.objects['Credits_close'].color= color_link
|
||||||
|
|
||||||
|
# Afficher les descriptions (14 maximum)
|
||||||
|
credits_description_list=list (credits_description)
|
||||||
|
for i in range(len(credits_description_list)):
|
||||||
|
scene.objects["Credits_url-"+str(i+1)]['Text']= credits_description[credits_description_list[i]][0]
|
||||||
|
scene.objects["Credits_url-"+str(i+1)].color= color_link
|
||||||
|
scene.objects["Credits_text-"+str(i+1)]['Text']= credits_description[credits_description_list[i]][1]
|
||||||
|
scene.objects["Credits_license-"+str(i+1)]['Text']= credits_description[credits_description_list[i]][3]
|
||||||
|
for i in range(len(credits_description_list), 14):
|
||||||
|
scene.objects["Credits_url-"+str(i+1)].setVisible(False,True)
|
||||||
|
scene.objects["Credits_text-"+str(i+1)].setVisible(False,True)
|
||||||
|
scene.objects["Credits_license-"+str(i+1)].setVisible(False,True)
|
||||||
|
|
||||||
|
def credits_close(cont):
|
||||||
|
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
||||||
|
|
||||||
|
# Revenir à la page About
|
||||||
|
scene.objects["Credits"].worldPosition.x = scene.objects["Credits"]['init_lx']
|
||||||
|
scene.objects["Credits"].worldPosition.y = scene.objects["Credits"]['init_ly']
|
||||||
|
scene.objects["Credits"].worldPosition.z = scene.objects["Credits"]['init_lz']
|
||||||
|
scene.objects["About"].worldPosition.x = scene.objects["About"]['init_lx']
|
||||||
|
scene.objects["About"].worldPosition.y = scene.objects["About"]['init_ly']
|
||||||
|
scene.objects["About"].worldPosition.z = scene.objects["About"]['init_lz']
|
||||||
|
scene.objects['Credits'].setVisible(False,True)
|
||||||
|
scene.objects['About'].setVisible(True,True)
|
||||||
|
|
||||||
|
def credits_link(cont):
|
||||||
|
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
||||||
|
obj = cont.owner
|
||||||
|
idx=int(obj.name[12:-7])
|
||||||
|
webbrowser.open(credits_description[list(credits_description)[idx-1]][2])
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Configuration
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
##
|
##
|
||||||
# Configuration de l'écran
|
# Taille de l'écran
|
||||||
##
|
##
|
||||||
|
|
||||||
def get_near_pos(array,value):
|
def get_near_pos(value_list,value):
|
||||||
array = np.asarray(array)
|
delta=[]
|
||||||
idx = (np.abs(array-value)).argmin()
|
for i in range (len(value_list)):
|
||||||
return idx
|
delta.append(abs(value-value_list[i]))
|
||||||
|
return delta.index(min(delta))
|
||||||
|
|
||||||
# Taille de l'écran +
|
# Taille de l'écran +
|
||||||
def screen_up(cont):
|
def screen_up(cont):
|
||||||
@ -122,8 +228,12 @@ def screen_up(cont):
|
|||||||
screen_mode_txt=["640x360", "960x540", "1280x720", "1920x1080"]
|
screen_mode_txt=["640x360", "960x540", "1280x720", "1920x1080"]
|
||||||
i = get_near_pos(screen_width_mode, bge.render.getWindowWidth())
|
i = get_near_pos(screen_width_mode, bge.render.getWindowWidth())
|
||||||
if i>=0 and i<3 :
|
if i>=0 and i<3 :
|
||||||
screen_width=screen_width_mode[i+1]
|
if bge.render.getWindowWidth()<screen_width_mode[i]:
|
||||||
screen_height=screen_height_mode[i+1]
|
screen_width=screen_width_mode[i]
|
||||||
|
screen_height=screen_height_mode[i]
|
||||||
|
else:
|
||||||
|
screen_width=screen_width_mode[i+1]
|
||||||
|
screen_height=screen_height_mode[i+1]
|
||||||
scene.objects['About_screen']['Text']= "Taille écran : "+str(screen_width) +" x "+str(screen_height)
|
scene.objects['About_screen']['Text']= "Taille écran : "+str(screen_width) +" x "+str(screen_height)
|
||||||
bge.render.setWindowSize(screen_width,screen_height)
|
bge.render.setWindowSize(screen_width,screen_height)
|
||||||
|
|
||||||
@ -149,8 +259,12 @@ def screen_down(cont):
|
|||||||
screen_mode_txt=["640x360", "960x540", "1280x720", "1920x1080"]
|
screen_mode_txt=["640x360", "960x540", "1280x720", "1920x1080"]
|
||||||
i = get_near_pos(screen_width_mode, bge.render.getWindowWidth())
|
i = get_near_pos(screen_width_mode, bge.render.getWindowWidth())
|
||||||
if i>0 and i<=3 :
|
if i>0 and i<=3 :
|
||||||
screen_width=screen_width_mode[i-1]
|
if bge.render.getWindowWidth()>screen_width_mode[i]:
|
||||||
screen_height=screen_height_mode[i-1]
|
screen_width=screen_width_mode[i]
|
||||||
|
screen_height=screen_height_mode[i]
|
||||||
|
else:
|
||||||
|
screen_width=screen_width_mode[i-1]
|
||||||
|
screen_height=screen_height_mode[i-1]
|
||||||
scene.objects['About_screen']['Text']= "Taille écran : "+str(screen_width) +" x "+str(screen_height)
|
scene.objects['About_screen']['Text']= "Taille écran : "+str(screen_width) +" x "+str(screen_height)
|
||||||
bge.render.setWindowSize(screen_width,screen_height)
|
bge.render.setWindowSize(screen_width,screen_height)
|
||||||
|
|
||||||
@ -167,3 +281,113 @@ def screen_down(cont):
|
|||||||
else:
|
else:
|
||||||
scene.objects['About_screen-up'].setVisible(True,True)
|
scene.objects['About_screen-up'].setVisible(True,True)
|
||||||
scene.objects['About_screen-up-colbox'].restorePhysics()
|
scene.objects['About_screen-up-colbox'].restorePhysics()
|
||||||
|
|
||||||
|
##
|
||||||
|
# Qualité du rendu
|
||||||
|
##
|
||||||
|
|
||||||
|
def quality_up(cont):
|
||||||
|
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
||||||
|
scene.objects['About']['quality'] +=1
|
||||||
|
quality_apply(scene.objects['About']['quality'])
|
||||||
|
|
||||||
|
# Boutons < et >
|
||||||
|
if scene.objects['About']['quality']==4:
|
||||||
|
scene.objects['About_quality-up'].setVisible(False,True)
|
||||||
|
scene.objects['About_quality-up-colbox'].suspendPhysics (True)
|
||||||
|
if scene.objects['About']['quality']==1:
|
||||||
|
scene.objects['About_quality-down'].setVisible(True,True)
|
||||||
|
scene.objects['About_quality-down-colbox'].restorePhysics()
|
||||||
|
|
||||||
|
def quality_down(cont):
|
||||||
|
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
|
||||||
|
scene.objects['About']['quality'] -=1
|
||||||
|
quality_apply(scene.objects['About']['quality'])
|
||||||
|
|
||||||
|
# Boutons < et >
|
||||||
|
if scene.objects['About']['quality']==0:
|
||||||
|
scene.objects['About_quality-down'].setVisible(False,True)
|
||||||
|
scene.objects['About_quality-down-colbox'].suspendPhysics (True)
|
||||||
|
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_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_taa_reprojection = True
|
||||||
|
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_taa_reprojection = True
|
||||||
|
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_taa_reprojection = True
|
||||||
|
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_taa_reprojection = True
|
||||||
|
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'
|
||||||
|
7
cine_config-bak.xml
Normal file
7
cine_config-bak.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<data>
|
||||||
|
<screen>
|
||||||
|
<width>1280</width>
|
||||||
|
<height>720</height>
|
||||||
|
<quality>4</quality>
|
||||||
|
</screen>
|
||||||
|
</data>
|
@ -1,6 +1,7 @@
|
|||||||
<data>
|
<data>
|
||||||
<screen>
|
<screen>
|
||||||
<width>1412</width>
|
<width>1548</width>
|
||||||
<height>794</height>
|
<height>871</height>
|
||||||
|
<quality>1</quality>
|
||||||
</screen>
|
</screen>
|
||||||
</data>
|
</data>
|
@ -14,9 +14,11 @@ import bge # Bibliothèque Blender Game Engine (UPBGE)
|
|||||||
scene = bge.logic.getCurrentScene()
|
scene = bge.logic.getCurrentScene()
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
color_link = [0.051, 0.270, 0.279,1] # Turquoise
|
color_link = (0.198, 0.109, 0.8, 1) # Violet
|
||||||
# color_link = [0.024, 0.006, 0.8, 1] # Bleu
|
color_link_hl = (0.8, 0.005, 0.315, 1) # Magenta
|
||||||
color_link_hl = [0.8, 0.005, 0.315, 1] # Magenta
|
# color_link = (0.051, 0.270, 0.279,1) # Turquoise
|
||||||
|
# color_link = (0.024, 0.006, 0.8, 1) # Bleu
|
||||||
|
# color_link = (0.8, 0.005, 0.315, 1) # Magenta
|
||||||
|
|
||||||
# UPBGE constants
|
# UPBGE constants
|
||||||
JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED
|
JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED
|
||||||
|
1
hemomixer/cine_config-bak.xml
Symbolic link
1
hemomixer/cine_config-bak.xml
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/lecteur-3d-cinematique/cine_config-bak.xml
|
BIN
hemomixer/hemomixer-17.blend
Normal file
BIN
hemomixer/hemomixer-17.blend
Normal file
Binary file not shown.
1
pince_schrader/cine_config-bak.xml
Symbolic link
1
pince_schrader/cine_config-bak.xml
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/lecteur-3d-cinematique/cine_config-bak.xml
|
BIN
pince_schrader/pince_schrader-08.blend
Normal file
BIN
pince_schrader/pince_schrader-08.blend
Normal file
Binary file not shown.
1
serrure_biometrique/cine_config-bak.xml
Symbolic link
1
serrure_biometrique/cine_config-bak.xml
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
/home/phroy/Bureau/seriousgames/blender-edutech/git/lecteur-3d-cinematique/cine_config-bak.xml
|
BIN
serrure_biometrique/serrure_biometrique-38.blend
Normal file
BIN
serrure_biometrique/serrure_biometrique-38.blend
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user