Skip to content

Commit 444adc0

Browse files
authored
Develop merge (#66)
* Adde basic pull request template for github * buildmaster: version update to 2.4.11 * Added light source UI panel * Added viewport render mode UI panel * Used viewport lights override options in Rendered mode * buildmaster: version update to 2.4.12 * Used light object scale in light source area calculations (#5) PURPOSE Make Area Light Intensity Normalization option account for light object scale. EFFECT OF CHANGE Area Light Intensity Normalization correctly uses light object scale. * buildmaster: version update to 2.4.13 * RPRBLND-1338: Back plates does not work correctly (#9) PURPOSE When disabling background override even if the file is still loaded, the backplate should not show up in production render. Backplates should work in viewport render. Code related to backplate could be simplified and improved. EFFECT OF CHANGE Fixed disabling backplate when background override is disabled. Made backplate work in Viewport render. Added "Crop" setting for Backplate panel, which provides option to user to crop background image due to render resolution. * buildmaster: version update to 2.4.14 * Fixed Viewport normalized Area Light scale application (#10) PURPOSE Fix: the Area Light scaling in Viewport doesn't change the normalized intensity. EFFECT OF CHANGE fixed: incorrect intensity normalization when scale changed in active viewport rendering mode. * buildmaster: version update to 2.4.15 * Allow CPU render for RPR 2 * Update render.py Update marketing ask on label to RPR 2.0 * Revert "Update render.py" This reverts commit 5d770c3. * Revert "Allow CPU render for RPR 2" This reverts commit b07916b. * RPRBLND-1361: Get blender crash with animation render. (#19) Fixed by moving moving AnimationEngine implementation to animation_engine_hybrid.py and set AnimationEngine for RPR and RPR2 equal to RennderEngine and RenderEngine2. * buildmaster: version update to 2.4.16 * Update render.py * [RPRBLND-1357] Fix RPR Image Texture node in non-full modes (#16) PURPOSE The RPR Image Texture node doesn't work in Hybrid modes. Reported in #12. The node is also applied sRGB gamma correction twice in sRGB mode. Fixes #12 EFFECT OF CHANGE fixed RPR Image Texture shader node in non-Full modes; fixed RPR Image Texture gamma correction. * buildmaster: version update to 2.4.17 * Add support for MULTIPLY_ADD mode of math Cycles node * buildmaster: version update to 2.4.18 * Revert "Merge branch 'develop' of https://github.com/GPUOpen-LibrariesAndSDKs/RadeonProRenderBlenderAddon into develop" This reverts commit 53ba68a, reversing changes made to 895f695. * Revert "Revert "Merge branch 'develop' of https://github.com/GPUOpen-LibrariesAndSDKs/RadeonProRenderBlenderAddon into develop"" This reverts commit a217a83. * buildmaster: version update to 2.4.19 * Change exported aov names to viewer format (#25) PURPOSE Scene exporter to RPR format uses different names for AOVs than rpr viewer. Fix it. EFFECT OF CHANGE exported AOV names changed to follow RPR Viewer standard; added Variance and Reflection Catcher AOVs to exported data. * Reverting back using image cache instead loading images from memory (#23) PURPOSE Loading images from blender memory could significantly slowdown export time for some scenes, even using fast foreach_get() method to get image data. EFFECT OF CHANGE Reverted back using image cache instead loading images from memory (relates to Blender 2.83+), which should increase speed of export for some scenes. * buildmaster: version update to 2.4.20 * [RPRBLND-1375] Log scene sync and render times (#24) PURPOSE Log scene synchronization and render times for informational and performance testing purposes. EFFECT OF CHANGE added scene sync and render times logging. * buildmaster: version update to 2.4.21 * RPRBLND-1385: Build 2.4.21 not installing in Blender. (#26) PURPOSE PR #23 produces import error during loading plugin. EFFECT OF CHANGE Fixed error during loading plugin. * buildmaster: version update to 2.4.22 * RPRBLND-1383: Name collision with collections. (#27) PURPOSE Appended object or material from other blend file can be in conflict with existent object or material with same name, which can be rendered as object or material from current scene. EFFECT OF CHANGE Fixed rendering objects which were appended from other blend files. * buildmaster: version update to 2.4.23 * RPRBLND-1372: Move to Core SDK 1.35.2. (#22) PURPOSE New Core 1.35.2 is available. EFFECT OF CHANGE Switched to latest Core SDK 1.35.2. * buildmaster: version update to 2.4.24 * RPRBLND-1383: Name collision with collections. (#32) PURPOSE After PR #27 changing material during viewport produces error. EFFECT OF CHANGE Fixed changing material during viewport render. * buildmaster: version update to 2.4.25 * Rprblnd 1380. Add support for Local mode "/" key in viewport (#30) PROBLEM: Blender has a "Local mode" to viewport which highlights the selected object only. RPR does not respect this. EFFECT: User sees only selected object when pressing / key. * buildmaster: version update to 2.4.26 * Update object from to_mesh if in edit mode in viewport (#33) PROBLEM: When switching to EDIT mode in the viewport, objects lose UVs. This is because Blender depsgraph treats objects differently in edit mode. We must use to_mesh in this instance EFFECT: Switching to EDIT mode now includes UV. * buildmaster: version update to 2.4.27 * RPRBLND-1392: Update Athena for Autotests. (#34) PURPOSE Team from automation tests on CIS wants to check Athena data which is transferred to AWS. Therefore they asked to provide possibility not to remove corresponded athena json files after sending. TECHNICAL STEPS Added config setting clean_athena_files (True by default), by which we can control removing athena json files after sending statistics. * buildmaster: version update to 2.4.28 * RPRBLND-1381 Mute nodes (#28) PURPOSE Support "Mute Node" key (M) EFFECT OF CHANGE Muting nodes has desired effect: A muted node passes through the first matching input (i.e if output is color, get the first color input). Or Returns black if that input is not linked. If No matching input, use the incoming socket default value. * buildmaster: version update to 2.4.29 * Add support for Object Info node (#36) EFFECT: Object Info Node works and is added to menu. Notes: Uses node.object and node.material extensively. Only part that doesn't work is random input in hybrid. * buildmaster: version update to 2.4.30 * Adjust adaptive tile size based on feedback (#37) EFFECT: Based on feedback from Users, on multi-GPU, adaptive sampling works better (less artifacts) with higher default tile size. Note, no changes observed with single GPU. * buildmaster: version update to 2.4.31 * Adapt viewport resolution to samples per second * Rprblnd-1382. Mapping node and generated lookup (#35) PURPOSE: Support UV mapping transformations better EFFECT: UV lookup "Generated" works better Vector mapping math is more correct in most instances. In particular before it was scaling/rotating in wrong order and rotating by x or y did not work * buildmaster: version update to 2.4.32 * Fixed basic adaptive resolution. * Improving adaptive resolution algorithm. * Removed viewport_resolution property as not needed * Removed resolution property as not needed. * Renamed variables, added property min_resolution_scale. * Implemented using requested_adapt_ratio instead requested_adapt_pixels. * Fixed blinking of viewport rendering during resizing and adapting resolution. It made by moving check for viewport updates (setting camera position and resizing) to the end of draw() function. * Added check that: render resolution <= viewport resoultion. Moved adaptive resolution settings to user settings. * Logged sync and render time in tiled final render mode (#40) PURPOSE Synchronization and render times aren't displayed in tiled final render mode log. Add it. EFFECT OF CHANGE synchronization and render times are correctly logged in tiled final render mode. * buildmaster: version update to 2.4.33 * set min to 25% * buildmaster: version update to 2.4.34 * Set the camera when exporting .rpr file (#43) EFFECT: Export engine now uses the scene camera when exporting. * buildmaster: version update to 2.4.35 * Per object material export (#39) PURPOSE: Currently we have a few (3) nodes that need to be exported per object. There may be more to come EFFECT: All materials are exported per object, even if shared. This may include some time increase, but images are re-used. * buildmaster: version update to 2.4.36 * Add previously unknown vector math modes (#41) * Add previously unknown vector math modes * add tan * rearrange logic * buildmaster: version update to 2.4.37 * Export engine use camera (#49) * Set the camera when exporting .rpr file * add error message if no camera set. * Need to set Camera matrix and aspect * buildmaster: version update to 2.4.38 * RPRBLND-1415: Fix of Adapt viewport resolution. (#48) * RPRBLND-1415: Adapt viewport resolution. Increasing MIN_PIXEL_DIFF to 0.5. * Improved algorithm of adapt viewport resolution: - fixed adaptation loop, now resolution is adapted only once - made algorithm more flexible * Fix with unsetting adapt_viewport_resolution + added constants. * buildmaster: version update to 2.4.39 * Rprblnd 1404 support vdb sequence (#50) PURPOSE OpenVDB objects can use sequence of VDB frames. Blender uses series of vdb files with frame number right before the file extension. Support it. Up to 6 leading zeroes in number is accepted, the frame number itself isn't limited in length. File names examples: test_1.vdb big_smoke.of.epic_scale.001.vdb test_1234567.vdb test_000007.vdb EFFECT OF CHANGE added support for OpenVDB sequences as a series of vdb files. Frame number in filename could have up to 6 leading zeroes. * buildmaster: version update to 2.4.40 * RPRBLND-1391: Export to *.rpr to directories which contains non latin chars. (#52) PURPOSE Exporting tto *.rpr to directories which contains non latin chars produces error: UnicodeEncodeError: 'latin-1' codec can't encode characters in position 15-19: ordinal not in range(256) EFFECT OF CHANGE Fixed export to *.rpr to directories which contains non latin chars * buildmaster: version update to 2.4.41 * Fixed tiles update for denoiser with active adaptive sampling (#54) PURPOSE Tiled render with active denoiser and adaptive sampling leaves black tiles in final result. It appeared on tiles that were stopped by noise threshold instead of samples number. The denoiser inputs just were not updated for such tiles leaving black tiles in final denoised result. EFFECT OF CHANGE fixed tiled render leaving black tiles woth denoiser and adaptive sampling. * buildmaster: version update to 2.4.42 * [RPRBLND-1117] Support image sequence texture (#53) PURPOSE Support Image Sequence for Image Texture shader node. EFFECT OF CHANGE added support for Image Sequence textures for Image Texture material shader node. * buildmaster: version update to 2.4.43 * RPRBLND-1420: Updating to new RIF 1.5.4 (#45) PURPOSE New RIF 1.5.3 is available with some improvements in ML filter using FP16 models. EFFECT OF CHANGE Updated to new RIF 1.5.3. Made ML filter to use FP16 models, which could speed up denoising process with less memory usage. 1. Make ML denoiser default 2. By default use AOV ML denoiser on mac. Black on color-only 3. Don't show 16 bit option. This will be used in viewport denoising only Co-authored-by: bsavery <[email protected]> * buildmaster: version update to 2.4.44 * [RPRBLND-1431] Disable anonymous usage statistincs on test and dev machines (#56) PURPOSE Add a way to disable statistics collection for development builds and testing machines. EFFECT OF CHANGE added environment variable RPR_DEV_DISABLE_STATISTICS check to disable anonymous usage statistics collection. Statistics disabled if variable is set to any non-empty value other than "False"; added config variable disable_athene_report to disable report via configuration. * Group id update to be consistent with Maya plugin (#58) EFFECT: Light groups AOVs are numbered 1-4 and choice between 1-4 in light. Instead of "key" or "fill" options. * buildmaster: version update to 2.4.45 * When only a selection change do not update anything or restart render (#57) PROBLEM: When changing selection render for viewport restarts. EFFECT: Save the list of selected objects and if a selection change do not restart the render. * buildmaster: version update to 2.4.46 * Light Groups AOVs are off by 1 * buildmaster: version update to 2.4.47 * Enable latest northstar (#51) * Enable latest northstar on Linux and update on windows * Enabling RPR 2.0 in Viewport rendering. * Removed metal flag from context creation in OSX for RPR 2.0 * Used latest RPR SDK changes from branch 355_beta * Enabled Curves render with RPR 2.0 * Disabled NorthStar on MacOS until the core fix is ready Co-authored-by: Bogdan Nagirniak Co-authored-by: Bogdan Nagirniak Co-authored-by: Mikhail Merzlyutin * buildmaster: version update to 2.4.48 * [RPRBLND-1419][RPRBLND-1422] Use RPR 2.0 Sphere and Disk lights for Point and Spot (#59) PURPOSE RPR 2.0 added physically correct light sources alternatives to Point Light and Spot Light - the Sphere Light and Disk Light. Use them when non-zero light size(radius) is used. EFFECT OF CHANGE added Shadow Soft Size to Point light and Spot light UI; RPR 2.0 uses more physically correct light render for Point and Spot light when Shadow Soft Size is set more than 0. TECHNICAL STEPS added Shadow Soft Size to Point light and Spot light UI, used existing Blender light property; added new light methods to wrapper builder conversion list; added RPR 2.0 Sphere and Disk light classes, used in RPR 2.0 mode; for compatibility added disk and sphere light placeholders in RPR 1.0 - used spot and point light for that; for compatibility added blank set_radius method to RPR 1.0 light base class; adjusted Sphere and Disk lights intensity using current light radius to keep the same result intesity; adjusted Sphere and Disk lights intensity on radius change. NOTES if light radius is big enough to intersect with illuminated object the dark areas will be present in areas of sphere intersection with said objects; Disk light result size changes with Disk light radius change;. softness doesn't change from angle., but raises from radius increase The different method of size calculation, that will account for angle(and visa-verse), is requred. * buildmaster: version update to 2.4.49 * [RPRBLND-1403] Support Vector Math shader node Wrap mode (#60) PURPOSE Vector Math node has "Wrap" mode. Add support for it. EFFECT OF CHANGE added support for "Wrap" mode of Vector Math shader node. * buildmaster: version update to 2.4.50 * Updated Northstar libraries for Mac and Win to the latest version (#61) * Updated Northstar libraries for Mac and Win to the latest version * Enable macOS * Updated to navi21 optimization fix binaries * Added separate Samples per View Update setting for RPR2 * Disabled adaptive sampling UI for RPR2 * Update Win and Mac binaries to the latest RPR2 core * buildmaster: version update to 2.4.51 * Progressive iterations (#62) PROBLEM: RPR 2.0 has best performance with higher iterations per render call. EFFECT: Remove "samples per view update" and replace with a progressively increasing # of samples. Note that because of the nature of path tracing renders, to get half the noise, we must double the number of samples. This PR makes a render use 1,1,2,4,8,16,32,32,32,.... iterations per render call. This is to give good user feedback and maximize performance. Also note that I enabled this in RPR 1 as well as 2.0. I would leave as a TODO that preview swatches should just do 32 samples per iteration. * add constant * fix enable adaptive threshold * buildmaster: version update to 2.4.52 * Forgotten lights classes aliases for Hybrid (#65) PURPOSE Hybrid-mode render doesn't work if Spot or non-zero sized Point light is present in scene. Solves #63 EFFECT OF CHANGE Hybrid starts correctly with Point and Spot lights. * buildmaster: version update to 2.4.53 * Bump version * buildmaster: version update to 2.5.1
1 parent bec827b commit 444adc0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1083
-631
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### PURPOSE
2+
What this PR is made for.
3+
4+
### EFFECT OF CHANGE
5+
Changes made to project from the user's point of view.
6+
7+
### TECHNICAL STEPS
8+
Changes made to code.
9+
10+
### NOTES FOR REVIEWERS
11+
Notes, if needed.

RadeonProImageProcessingSDK

RadeonProRenderSDK

Submodule RadeonProRenderSDK updated 79 files

cmd_tools/create_sdk.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,27 +109,27 @@ def copy_rif_sdk():
109109
shutil.copy(str(lib), str(sdk_lib_dir))
110110

111111
elif OS == 'Linux':
112-
shutil.copy(str(bin_dir / "libRadeonImageFilters.so.1.5.1"),
112+
shutil.copy(str(bin_dir / "libRadeonImageFilters.so.1.5.4"),
113113
str(sdk_bin_dir / "libRadeonImageFilters.so"))
114-
shutil.copy(str(bin_dir / "libRadeonML-MIOpen.so.0.9.2"),
115-
str(sdk_bin_dir / "libRadeonML-MIOpen.so"))
114+
shutil.copy(str(bin_dir / "libRadeonML_MIOpen.so.0.9.7"),
115+
str(sdk_bin_dir / "libRadeonML_MIOpen.so"))
116116
shutil.copy(str(bin_dir / "libOpenImageDenoise.so.0.9.0"),
117117
str(sdk_bin_dir / "libOpenImageDenoise.so"))
118118
shutil.copy(str(bin_dir / "libMIOpen.so.2.0.1"),
119119
str(sdk_bin_dir / "libMIOpen.so.2"))
120120

121121
elif OS == 'Darwin':
122-
shutil.copy(str(bin_dir / "libRadeonImageFilters.1.5.1.dylib"),
122+
shutil.copy(str(bin_dir / "libRadeonImageFilters.1.5.4.dylib"),
123123
str(sdk_bin_dir / "libRadeonImageFilters.dylib"))
124124
shutil.copy(str(bin_dir / "libOpenImageDenoise.0.9.0.dylib"),
125125
str(sdk_bin_dir / "libOpenImageDenoise.dylib"))
126-
shutil.copy(str(bin_dir / "libRadeonML-MPS.0.9.2.dylib"),
127-
str(sdk_bin_dir / "libRadeonML-MPS.dylib"))
126+
shutil.copy(str(bin_dir / "libRadeonML_MPS.0.9.7.dylib"),
127+
str(sdk_bin_dir / "libRadeonML_MPS.dylib"))
128128

129129
# adjusting id of RIF libs
130130
install_name_tool('-id', "@rpath/libRadeonImageFilters.dylib", sdk_bin_dir / "libRadeonImageFilters.dylib")
131131
install_name_tool('-id', "@rpath/libOpenImageDenoise.dylib", sdk_bin_dir / "libOpenImageDenoise.dylib")
132-
install_name_tool('-id', "@rpath/libRadeonML-MPS.dylib", sdk_bin_dir / "libRadeonML-MPS.dylib")
132+
install_name_tool('-id', "@rpath/libRadeonML_MPS.dylib", sdk_bin_dir / "libRadeonML_MPS.dylib")
133133

134134
else:
135135
raise KeyError("Unsupported OS", OS)

src/bindings/pyrpr/pyrprwrap_make.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def print_function_header(name, args_names, args_defaults, doc):
105105
'rprObject', 'rprShape', 'rprCamera', 'rprMesh',
106106
'rprMaterialSystem', 'rprMaterialNode',
107107
'rprLight', 'rprPointLight', 'rprSpotLight',
108-
'rprDirectionalLight',
108+
'rprDirectionalLight', 'rprDiskLight', 'rprSphereLight',
109109
'rprEnvironmentLight', 'rprSkyLight',
110110
'rprPostEffect',
111111
'rprIESLight',

src/bindings/pyrpr/rpr.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,11 @@ def write_api(api_desc_fpath, f, abi_mode):
116116
print(name)
117117
# if a constant is actually a variable to another constant reference that
118118
if "RPR_" + c.value in api.constants.keys():
119-
print('#define', name, pyrprapi.eval_constant(api.constants["RPR_" + c.value].value) if
120-
abi_mode else '...' , file=f)
119+
print('#define', name, pyrprapi.eval_constant(api.constants["RPR_" + c.value].value)
120+
if abi_mode else '...', file=f)
121+
elif "RIF_" + c.value in api.constants.keys():
122+
print('#define', name, pyrprapi.eval_constant(api.constants["RIF_" + c.value].value)
123+
if abi_mode else '...', file=f)
121124
else:
122125
print('#define', name, pyrprapi.eval_constant(c.value) if abi_mode else '...', file=f)
123126
for name, t in api.types.items():

src/bindings/pyrpr/src/pyrpr.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ def get_device(create_flag, info_flag):
301301
cls.gpu_devices = []
302302
for i in range(16):
303303
create_flag = getattr(pyrprwrap, 'CREATION_FLAGS_ENABLE_GPU%d' % i)
304-
if platform.system() == 'Darwin':
305-
create_flag = create_flag | CREATION_FLAGS_ENABLE_METAL
304+
create_flag = create_flag if platform.system() != 'Darwin' \
305+
else (create_flag | CREATION_FLAGS_ENABLE_METAL)
306306
device = get_device(create_flag, getattr(pyrprwrap, 'CONTEXT_GPU%d_NAME' % i))
307307
if not device:
308308
break
@@ -467,7 +467,6 @@ def clear(self):
467467
self.subdivision_camera = None
468468
self.objects = set()
469469

470-
471470
def set_camera(self, camera):
472471
self.camera = camera
473472
SceneSetCamera(self, self.camera)
@@ -488,6 +487,10 @@ def set_background_image(self, image):
488487
self.background_image = image
489488
SceneSetBackgroundImage(self, image)
490489

490+
def set_background_color(self, r, g, b):
491+
self.set_background_image(
492+
ImageData(self.context, np.full((2, 2, 4), (r, g, b, 1.0), dtype=np.float32)))
493+
491494
def add_environment_override(self, core_id, light):
492495
self.environment_overrides[core_id] = light
493496
EnvironmentLightSetEnvironmentLightOverride(self.environment_light, core_id, light)
@@ -1262,6 +1265,10 @@ def __init__(self, context):
12621265
def set_radiant_power(self, r, g, b):
12631266
PointLightSetRadiantPower3f(self, r, g, b)
12641267

1268+
def set_radius(self, radius):
1269+
""" Supported in RPR 2.0 Sphere Light """
1270+
pass
1271+
12651272

12661273
class SpotLight(Light):
12671274
def __init__(self, context):
@@ -1274,6 +1281,10 @@ def set_radiant_power(self, r, g, b):
12741281
def set_cone_shape(self, iangle, oangle):
12751282
SpotLightSetConeShape(self, iangle, oangle)
12761283

1284+
def set_radius(self, radius):
1285+
""" Supported in RPR 2.0 Disk Light """
1286+
pass
1287+
12771288

12781289
class DirectionalLight(Light):
12791290
def __init__(self, context):

src/bindings/pyrpr/src/pyrpr2.py

Lines changed: 47 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1+
import math
12
import numpy as np
23

34
import pyrpr
4-
5+
from pyrprwrap import (
6+
ContextCreateSphereLight,
7+
SphereLightSetRadiantPower3f,
8+
SphereLightSetRadius,
9+
ContextCreateDiskLight,
10+
DiskLightSetRadiantPower3f,
11+
DiskLightSetRadius,
12+
DiskLightSetAngle,
13+
)
514

615
# will be used in other modules to check if RPR 2 is enabled
716
enabled = False
@@ -11,26 +20,47 @@ class Context(pyrpr.Context):
1120
pass
1221

1322

14-
class Scene(pyrpr.Scene):
15-
def attach(self, obj):
16-
if isinstance(obj, pyrpr.Curve):
17-
return
23+
class SphereLight(pyrpr.Light):
24+
def __init__(self, context):
25+
super().__init__(context)
26+
ContextCreateSphereLight(self.context, self)
27+
28+
# keep target intensity and radius to adjust actual intensity when they are changed
29+
self._radius_squared = 1
30+
31+
def set_radiant_power(self, r, g, b):
32+
# Adjust intensity by current radius
33+
SphereLightSetRadiantPower3f(self,
34+
r / self._radius_squared,
35+
g / self._radius_squared,
36+
b / self._radius_squared)
1837

19-
super().attach(obj)
38+
def set_radius(self, radius):
39+
radius = max(radius, 0.01)
40+
self._radius_squared = radius * radius
41+
SphereLightSetRadius(self, radius)
2042

2143

22-
class Curve(pyrpr.Curve):
23-
def __init__(self, context, control_points, points_radii, uvs):
24-
pass
44+
class DiskLight(pyrpr.Light):
45+
def __init__(self, context):
46+
super().__init__(context)
47+
ContextCreateDiskLight(self.context, self)
2548

26-
def delete(self):
27-
pass
49+
# keep target intensity and radius to adjust actual intensity when they are changed
50+
self._radius_squared = 1
2851

29-
def set_material(self, material):
30-
pass
52+
def set_radiant_power(self, r, g, b):
53+
# Adjust intensity by current radius
54+
DiskLightSetRadiantPower3f(self,
55+
r / self._radius_squared,
56+
g / self._radius_squared,
57+
b / self._radius_squared)
3158

32-
def set_transform(self, transform: np.array, transpose=True):
33-
pass
59+
def set_cone_shape(self, iangle, oangle):
60+
# Use external angle oangle
61+
DiskLightSetAngle(self, oangle)
3462

35-
def set_name(self, name):
36-
self.name = name
63+
def set_radius(self, radius):
64+
radius = max(radius, 0.01)
65+
self._radius_squared = radius * radius
66+
DiskLightSetRadius(self, radius)

src/bindings/pyrpr/src/pyrpr_load_store.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# limitations under the License.
1414
#********************************************************************
1515
import platform
16-
import _cffi_backend
1716
from _pyrpr_load_store import ffi
17+
import pyrpr
1818

1919
lib = None
2020

@@ -28,16 +28,13 @@ def init(rpr_sdk_bin_path):
2828

2929

3030
def export(name, context, scene, flags):
31-
32-
file_name = bytes(name, encoding="latin1")
33-
3431
# last param defines export bit flags.
3532
# image handling type flags:
3633
# RPRLOADSTORE_EXPORTFLAG_EXTERNALFILES (1 << 0) - image data will be stored to rprsb external file
3734
# RPRLOADSTORE_EXPORTFLAG_COMPRESS_IMAGE_LEVEL_1 (1 << 1) - image data will be lossless compressed during export
3835
# RPRLOADSTORE_EXPORTFLAG_COMPRESS_IMAGE_LEVEL_2 (1 << 2) - image data will be lossy compressed during export
3936
# note: without any of above flags images will not be exported.
40-
return lib.rprsExport(file_name, context._get_handle(), scene._get_handle(),
37+
return lib.rprsExport(pyrpr.encode(name), context._get_handle(), scene._get_handle(),
4138
0, ffi.NULL, ffi.NULL, 0, ffi.NULL, ffi.NULL, flags)
4239

4340

src/bindings/pyrpr/src/pyrprimagefilters.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,9 @@ def set_parameter(self, name, value):
291291
if name in self.parameters and self.parameters[name] == value:
292292
return
293293

294-
if isinstance(value, (int, bool)):
294+
if name == 'compute_type':
295+
ImageFilterSetComputeType(self, value)
296+
elif isinstance(value, (int, bool)):
295297
ImageFilterSetParameter1u(self, pyrpr.encode(name), int(value))
296298
self.parameters[name] = value
297299
elif isinstance(value, float):
@@ -346,6 +348,9 @@ def detach_image_filters(self):
346348
def execute(self):
347349
ContextExecuteCommandQueue(self.context, self, ffi.NULL, ffi.NULL, ffi.NULL)
348350

351+
def synchronize(self):
352+
SyncronizeQueue(self)
353+
349354
def delete(self):
350355
self.detach_image_filters()
351356
super().delete()

0 commit comments

Comments
 (0)