Skip to content

Commit

Permalink
Updated HDR loading code
Browse files Browse the repository at this point in the history
  • Loading branch information
RodZill4 committed Mar 14, 2023
1 parent ac7d453 commit bf7c953
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions material_maker/tools/environment_manager/environment_manager.gd
Expand Up @@ -184,13 +184,14 @@ func _physics_process(_delta) -> void:
progress_window.set_progress(float($HTTPRequest.get_downloaded_bytes())/float($HTTPRequest.get_body_size()))

func set_hdr(index, hdr_path) -> bool:
print("Setting hdr "+hdr_path)
var hdr : Texture = load(hdr_path)
if hdr == null:
hdr = ImageTexture.new()
if hdr.load(hdr_path) != OK:
return false
var hdr_image : Image = Image.new()
if hdr_image.load(hdr_path) != OK:
return false
var hdr : ImageTexture = ImageTexture.new()
hdr.storage = ImageTexture.STORAGE_COMPRESS_LOSSLESS
hdr.create_from_image(hdr_image)
environment_textures[index].hdri = hdr
print(hdr.storage)
return true

func new_environment(index : int) -> void:
Expand Down

0 comments on commit bf7c953

Please sign in to comment.