Command Line Interface¶
This guide covers all command line options for VulkanW3DViewer.
Usage¶
Arguments¶
model¶
Optional positional argument specifying a W3D file to load on startup.
If not provided, the viewer starts with the file browser open.
Options¶
-h, --help¶
Display help message and exit.
Output:
W3D Viewer - A Vulkan-based viewer for W3D 3D model files from Command & Conquer Generals
Usage: VulkanW3DViewer [model] [OPTIONS]
Arguments:
model W3D model file to load on startup
Options:
-h,--help Display help message and exit
-t,--textures PATH Set custom texture search path
-d,--debug Enable verbose debug output
-t, --textures PATH¶
Set a custom texture search path.
./VulkanW3DViewer model.w3d -t /path/to/textures
./VulkanW3DViewer model.w3d --textures /path/to/textures
Purpose: Specify where to look for texture files referenced by the W3D model.
Validation: Path must be an existing directory.
Search Order:
- Same directory as the W3D file
- Custom texture path (this option)
-d, --debug¶
Enable verbose debug output.
Output includes:
- W3D chunk parsing details
- Texture loading status
- Vulkan resource creation
- Frame timing information
Examples¶
Basic Launch¶
Open the viewer with the file browser:
Load Specific Model¶
Open a model directly:
Load with Texture Path¶
Specify custom texture location:
Debug Mode¶
Enable verbose output for troubleshooting:
Full Example¶
Combine all options:
Exit Codes¶
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error (invalid arguments, file not found, etc.) |
Environment Variables¶
VULKAN_SDK¶
Required for shader compilation. Set automatically by Vulkan SDK installer.
Path Handling¶
Relative Paths¶
Relative paths are resolved from the current working directory:
Absolute Paths¶
Absolute paths work as expected:
Paths with Spaces¶
Quote paths containing spaces:
Shell Integration¶
Bash Completion¶
Tab completion works for file paths:
File Associations¶
Associate .w3d files with the viewer:
Scripting¶
Batch Processing¶
Process multiple files (basic example):
Viewer is Interactive
The viewer is primarily interactive. For batch processing, you may need to add support for headless mode or automated screenshot capture.
Troubleshooting¶
"File not found"¶
- Check the file path is correct
- Verify file exists:
ls -la path/to/model.w3d - Use absolute path to eliminate ambiguity
"Invalid texture path"¶
- Path must be a directory, not a file
- Directory must exist
- Check permissions
No Output¶
- Add
--debugflag for verbose output - Check stderr:
./VulkanW3DViewer model.w3d 2>&1