@@ -139,6 +139,11 @@ export float mx_image_float(
139139 anno::description("Enumeration {constant,clamp,periodic,mirror}."),
140140 anno::display_name("Frame End Action"),
141141 anno::unused()
142+ ]],
143+ uniform bool mxp_flip_v = false
144+ [[
145+ anno::usage("for applying the 'fileTextureVerticalFlip' shader generator option."),
146+ anno::hidden()
142147 ]]
143148)
144149 [[
@@ -153,7 +158,9 @@ export float mx_image_float(
153158 return mxp_default;
154159
155160 float returnValue = ::tex::lookup_float(tex: mxp_file,
156- coord: mxp_texcoord,
161+ coord: mxp_flip_v
162+ ? float2(mxp_texcoord.x, 1.0f - mxp_texcoord.y)
163+ : mxp_texcoord,
157164 wrap_u: map_addressmode(mxp_uaddressmode),
158165 wrap_v: map_addressmode(mxp_vaddressmode));
159166 return returnValue;
@@ -207,6 +214,11 @@ export color mx_image_color3(
207214 anno::description("Enumeration {constant,clamp,periodic,mirror}."),
208215 anno::display_name("Frame End Action"),
209216 anno::unused()
217+ ]],
218+ uniform bool mxp_flip_v = false
219+ [[
220+ anno::usage("for applying the 'fileTextureVerticalFlip' shader generator option."),
221+ anno::hidden()
210222 ]]
211223)
212224 [[
@@ -221,7 +233,9 @@ export color mx_image_color3(
221233 return mxp_default;
222234
223235 color returnValue = ::tex::lookup_color(tex: mxp_file,
224- coord: mxp_texcoord,
236+ coord: mxp_flip_v
237+ ? float2(mxp_texcoord.x, 1.0f - mxp_texcoord.y)
238+ : mxp_texcoord,
225239 wrap_u: map_addressmode(mxp_uaddressmode),
226240 wrap_v: map_addressmode(mxp_vaddressmode));
227241 return returnValue;
@@ -275,6 +289,11 @@ export color4 mx_image_color4(
275289 anno::description("Enumeration {constant,clamp,periodic,mirror}."),
276290 anno::display_name("Frame End Action"),
277291 anno::unused()
292+ ]],
293+ uniform bool mxp_flip_v = false
294+ [[
295+ anno::usage("for applying the 'fileTextureVerticalFlip' shader generator option."),
296+ anno::hidden()
278297 ]]
279298)
280299 [[
@@ -289,7 +308,9 @@ export color4 mx_image_color4(
289308 return mxp_default;
290309
291310 color4 returnValue = mk_color4( ::tex::lookup_float4(tex: mxp_file,
292- coord: mxp_texcoord,
311+ coord: mxp_flip_v
312+ ? float2(mxp_texcoord.x, 1.0f - mxp_texcoord.y)
313+ : mxp_texcoord,
293314 wrap_u: map_addressmode(mxp_uaddressmode),
294315 wrap_v: map_addressmode(mxp_vaddressmode)));
295316 return returnValue;
@@ -343,6 +364,11 @@ export float2 mx_image_vector2(
343364 anno::description("Enumeration {constant,clamp,periodic,mirror}."),
344365 anno::display_name("Frame End Action"),
345366 anno::unused()
367+ ]],
368+ uniform bool mxp_flip_v = false
369+ [[
370+ anno::usage("for applying the 'fileTextureVerticalFlip' shader generator option."),
371+ anno::hidden()
346372 ]]
347373)
348374 [[
@@ -357,7 +383,9 @@ export float2 mx_image_vector2(
357383 return mxp_default;
358384
359385 float2 returnValue = ::tex::lookup_float2(tex: mxp_file,
360- coord: mxp_texcoord,
386+ coord: mxp_flip_v
387+ ? float2(mxp_texcoord.x, 1.0f - mxp_texcoord.y)
388+ : mxp_texcoord,
361389 wrap_u: map_addressmode(mxp_uaddressmode),
362390 wrap_v: map_addressmode(mxp_vaddressmode));
363391 return returnValue;
@@ -411,6 +439,11 @@ export float3 mx_image_vector3(
411439 anno::description("Enumeration {constant,clamp,periodic,mirror}."),
412440 anno::display_name("Frame End Action"),
413441 anno::unused()
442+ ]],
443+ uniform bool mxp_flip_v = false
444+ [[
445+ anno::usage("for applying the 'fileTextureVerticalFlip' shader generator option."),
446+ anno::hidden()
414447 ]]
415448)
416449 [[
@@ -425,7 +458,9 @@ export float3 mx_image_vector3(
425458 return mxp_default;
426459
427460 float3 returnValue = ::tex::lookup_float3(tex: mxp_file,
428- coord: mxp_texcoord,
461+ coord: mxp_flip_v
462+ ? float2(mxp_texcoord.x, 1.0f - mxp_texcoord.y)
463+ : mxp_texcoord,
429464 wrap_u: map_addressmode(mxp_uaddressmode),
430465 wrap_v: map_addressmode(mxp_vaddressmode));
431466 return returnValue;
@@ -479,6 +514,11 @@ export float4 mx_image_vector4(
479514 anno::description("Enumeration {constant,clamp,periodic,mirror}."),
480515 anno::display_name("Frame End Action"),
481516 anno::unused()
517+ ]],
518+ uniform bool mxp_flip_v = false
519+ [[
520+ anno::usage("for applying the 'fileTextureVerticalFlip' shader generator option."),
521+ anno::hidden()
482522 ]]
483523)
484524 [[
@@ -493,7 +533,9 @@ export float4 mx_image_vector4(
493533 return mxp_default;
494534
495535 float4 returnValue = ::tex::lookup_float4(tex: mxp_file,
496- coord: mxp_texcoord,
536+ coord: mxp_flip_v
537+ ? float2(mxp_texcoord.x, 1.0f - mxp_texcoord.y)
538+ : mxp_texcoord,
497539 wrap_u: map_addressmode(mxp_uaddressmode),
498540 wrap_v: map_addressmode(mxp_vaddressmode));
499541 return returnValue;
0 commit comments