Skip to content

Commit b9bb6d0

Browse files
committed
remove keep_on_host arg from load_displacement and load_normal_tilt (always set to false)
1 parent a91a886 commit b9bb6d0

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

plotoptix/npoptix.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,13 +1029,13 @@ def load_normal_tilt(self, name: str, file_name: str,
10291029
mapping: Union[TextureMapping, str] = TextureMapping.Flat,
10301030
prescale: float = 1.0,
10311031
baseline: float = 0.0,
1032-
keep_on_host: bool = False,
10331032
refresh: bool = False) -> None:
10341033
"""Set normal tilt data.
10351034
1036-
Set shading normal tilt according to displacement loaded from an image file. ``mapping``
1035+
Set shading normal tilt according to displacement map loaded from an image file. ``mapping``
10371036
determines how the normal tilt is calculated from the displacement data
1038-
(see :class:`plotoptix.enums.TextureMapping`).
1037+
(see :class:`plotoptix.enums.TextureMapping`). Tilt data is stored in the device memory only
1038+
(there is no host copy).
10391039
10401040
Parameters
10411041
----------
@@ -1049,8 +1049,6 @@ def load_normal_tilt(self, name: str, file_name: str,
10491049
Scaling factor for displacement values.
10501050
baseline : float, optional
10511051
Baseline added to displacement values.
1052-
keep_on_host : bool, optional
1053-
Store texture data copy in the host memory.
10541052
refresh : bool, optional
10551053
Set to ``True`` if the image should be re-computed.
10561054
"""
@@ -1060,8 +1058,7 @@ def load_normal_tilt(self, name: str, file_name: str,
10601058
if isinstance(mapping, str): mapping = TextureMapping[mapping]
10611059

10621060
self._logger.info("Set shading normal tilt map for %s using %s.", name, file_name)
1063-
if not self._optix.load_normal_tilt(name, file_name, mapping.value, prescale, baseline,
1064-
keep_on_host, refresh):
1061+
if not self._optix.load_normal_tilt(name, file_name, mapping.value, prescale, baseline, refresh):
10651062
msg = "%s normal tilt map not uploaded." % name
10661063
self._logger.error(msg)
10671064
if self._raise_on_error: raise RuntimeError(msg)
@@ -1112,16 +1109,12 @@ def set_displacement(self, name: str, data: Any,
11121109
def load_displacement(self, name: str, file_name: str,
11131110
prescale: float = 1.0,
11141111
baseline: float = 0.0,
1115-
keep_on_host: bool = False,
11161112
refresh: bool = False) -> None:
11171113
"""Load surface displacement data from file.
11181114
11191115
Load displacement data for the object ``name`` from an image file. Geometry attribute
11201116
program of the object has to be set to :attr:`plotoptix.enums.GeomAttributeProgram.DisplacedSurface`.
1121-
1122-
Use ``keep_on_host=True`` to make a copy of data in the host memory (in addition to GPU
1123-
memory), this option is required when (small) arrays are going to be saved to JSON
1124-
description of the scene.
1117+
Tilt data is stored in the device memory only (there is no host copy).
11251118
11261119
Parameters
11271120
----------
@@ -1133,17 +1126,14 @@ def load_displacement(self, name: str, file_name: str,
11331126
Scaling factor for displacement values.
11341127
baseline : float, optional
11351128
Baseline added to displacement values.
1136-
keep_on_host : bool, optional
1137-
Store texture data copy in the host memory.
11381129
refresh : bool, optional
11391130
Set to ``True`` if the image should be re-computed.
11401131
"""
11411132
if not isinstance(name, str): name = str(name)
11421133
if not isinstance(file_name, str): name = str(file_name)
11431134

11441135
self._logger.info("Set displacement map for %s using %s.", name, file_name)
1145-
if not self._optix.load_displacement(name, file_name, prescale, baseline,
1146-
keep_on_host, refresh):
1136+
if not self._optix.load_displacement(name, file_name, prescale, baseline, refresh):
11471137
msg = "%s displacement map not uploaded." % name
11481138
self._logger.error(msg)
11491139
if self._raise_on_error: raise RuntimeError(msg)

0 commit comments

Comments
 (0)