Skip to content

Commit fd640ae

Browse files
authored
Merge pull request #8160 from AMajesticSeaFlapFlap/develop
Added manual type selection to Ops.Ui.VizTexture.js
2 parents ffe6dae + 86d5f29 commit fd640ae

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

src/ops/base/Ops.Ui.VizTexture/Ops.Ui.VizTexture.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ const
66
inRgbe = op.inBool("Convert RGBE", false),
77

88
inRGB = op.inSwitch("Channels", ["RGB", "R", "G", "B"], "RGB"),
9-
9+
inType = op.inSwitch("Type", ["Automatic", "Default", "Depth", "Cubemap"], "Automatic"),
10+
1011
inPickColor = op.inBool("Show Color", false),
1112
inX = op.inFloatSlider("X", 0.5),
1213
inY = op.inFloatSlider("Y", 0.5),
@@ -131,13 +132,25 @@ op.renderVizLayerGl = (ctx, layer) =>
131132

132133
const oldTex = cgl.getTexture(texSlot);
133134
const oldTexCubemap = cgl.getTexture(texSlotCubemap);
134-
135+
136+
let iTexType = inType.get();
135137
let texType = 0;
136138
if (portTex)
137139
{
138-
if (portTex.cubemap) texType = 1;
139-
if (portTex.textureType == CGL.Texture.TYPE_DEPTH) texType = 2;
140-
140+
if (iTexType == "Automatic")
141+
{
142+
if (portTex.cubemap) texType = 1;
143+
if (portTex.textureType == CGL.Texture.TYPE_DEPTH) texType = 2;
144+
}
145+
else if (iTexType == "Depth")
146+
{
147+
texType = 2;
148+
}
149+
else if (iTexType == "Cubemap")
150+
{
151+
texType = 1;
152+
}
153+
141154
if (texType == 0 || texType == 2)
142155
{
143156
cgl.setTexture(texSlot, portTex.tex);

0 commit comments

Comments
 (0)