Skip to content

Commit

Permalink
viewer: Revert accidentally committed IBL code
Browse files Browse the repository at this point in the history
  • Loading branch information
Moguri committed Oct 28, 2024
1 parent da1db08 commit 2039137
Showing 1 changed file with 2 additions and 34 deletions.
36 changes: 2 additions & 34 deletions gltf/viewer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import math
import os
from pathlib import Path
import sys

from direct.showbase.ShowBase import ShowBase
Expand All @@ -15,11 +14,6 @@
'window-size 1024 768\n'
'texture-minfilter mipmap\n'
'texture-anisotropic-degree 16\n'
'notify-level-simplepbr info\n'
'show-frame-rate-meter true\n'
'frame-rate-meter-milliseconds true\n'
'gl-version 3 2\n'
'gl-debug t\n'
)


Expand All @@ -31,22 +25,7 @@ def __init__(self):

super().__init__()

cubemap_path = Path(__file__).parent / 'hdri' / '512_cg_#.hdr'
# cubemap_path = p3d.Filename.from_os_specific(
# os.path.join(os.path.dirname(__file__), '..', 'cubemap.env')
# )
self.env_map = simplepbr.EnvPool.ptr().load(
cubemap_path,
# prefiltered_size=256,
# prefiltered_samples=16
)
# self.env_map = simplepbr.EnvMap.from_file_path(cubemap_path)
self.pipeline = simplepbr.init(
# env_map=self.env_map,
use_normal_maps=True,
)

self.set_background_color(0, 0, 0, 1)
self.pipeline = simplepbr.init()

infile = p3d.Filename.from_os_specific(os.path.abspath(sys.argv[1]))
p3d.get_model_path().prepend_directory(infile.get_dirname())
Expand All @@ -64,8 +43,6 @@ def __init__(self):
self.accept('e', self.toggle_emission_maps)
self.accept('o', self.toggle_occlusion_maps)
self.accept('a', self.toggle_ambient_light)
self.accept('i', self.toggle_ibl)
# self.accept('b', self.toggle_calc_binormals)
self.accept('shift-l', self.model_root.ls)
self.accept('shift-a', self.model_root.analyze)

Expand Down Expand Up @@ -101,7 +78,7 @@ def __init__(self):

# Add some ambient light
self.ambient = self.render.attach_new_node(p3d.AmbientLight('ambient'))
self.ambient.node().set_color((.1, .1, .1, 1))
self.ambient.node().set_color((.2, .2, .2,.2))
self.render.set_light(self.ambient)

if self.model_root.find('**/+Character'):
Expand All @@ -125,15 +102,6 @@ def toggle_ambient_light(self):
else:
self.render.set_light(self.ambient)

def toggle_ibl(self):
if self.pipeline.env_map:
self.pipeline.env_map = None
else:
self.pipeline.env_map = self.env_map

def toggle_calc_binormals(self):
self.pipeline.calculate_binormals = not self.pipeline.calculate_binormals

def main():
App().run()

Expand Down

0 comments on commit 2039137

Please sign in to comment.