baldurk / renderdoc

RenderDoc is a stand-alone graphics debugging tool.
https://renderdoc.org
MIT License
9.12k stars 1.36k forks source link

Save a texture to disk(python api) Example Source Can not be used? #2290

Closed lpcdma closed 3 years ago

lpcdma commented 3 years ago

Description

The picture cannot be saved using the windows command line (the picture is black when it is opened)

download source code form https://renderdoc.org/docs/python_api/examples/renderdoc/save_texture.html

Steps to reproduce

use Python Shell Save the picture normally use windows console The same code picture becomes black According to the following code, it should be possible to run without Python Shell?

else:
    rd.InitialiseReplay(rd.GlobalEnvironment(), [])

    if len(sys.argv) <= 1:
        print('Usage: python3 {} filename.rdc'.format(sys.argv[0]))
        sys.exit(0)

    cap,controller = loadCapture(sys.argv[1])

    sampleCode(controller)

    controller.Shutdown()
    cap.Shutdown()

    rd.ShutdownReplay()

Environment

baldurk commented 3 years ago

I don't understand what problem you're describing, please give much more detail about what you are doing and what is going wrong. Your steps to reproduce are not complete too, you need to describe what I can do to reproduce the problem - the steps you have given are much too vague and the python snippet you have pasted is incomplete.

lpcdma commented 3 years ago

I don't understand what problem you're describing, please give much more detail about what you are doing and what is going wrong. Your steps to reproduce are not complete too, you need to describe what I can do to reproduce the problem - the steps you have given are much too vague and the python snippet you have pasted is incomplete.

download save_texture.py add code image

import sys
import os

sys.path.append('C:/Users/username/Downloads/renderdoc-1.14/x64/Development/pymodules')
os.environ["PATH"] += os.pathsep + os.path.abspath('C:/Users/username/Downloads/renderdoc-1.14/x64/Development')
if sys.platform == 'win32' and sys.version_info[1] >= 8:
    print("AAAAAAAAAAA")
    os.add_dll_directory("C:/Users/username/Downloads/renderdoc-1.14/x64/Development")

Use windows console: image Use Python Shell image

Test RDC file

Test RDC file

Test RDC file

baldurk commented 3 years ago

I can't reproduce this, the texture is saved correctly for me whether running in the python shell or via the python module directly.

This capture was made on an Android device in OpenGL ES which you didn't mention. In the UI are you replaying on an Android device or on your computer? The python script replays directly on your computer and generally speaking replaying OpenGL ES on desktop is not recommended and most drivers are unable to do so correctly, only nvidia in my experience can do it at all. If you're replaying on Android in the UI that would explain the difference.

baldurk commented 3 years ago

Closing this due to lack of activity and no further information to investigate.