Author Topic: GPU script: conditional function fails to compile for equality (1.10.4 Pro)  (Read 290 times)

Rodolfo Calabrezi

  • Jr. Member
  • **
  • Posts: 8
  • INSANE Games Sr. Technical Artist
Hey there!

New user here! :0) I'm loving using Instant Terra, congrats for the great work. I'll be happy if I can be of any help.

When I use a GPU script with an IF() function, it works except when using equality. It won't compile if inside condition I use the "=" symbol. So a typical switch case was simulated using:

Code: [Select]
result = IF(Index < 1; height_0; IF(Index < 2; height_1; IF(Index < 3; height_2; height_3)))
Instead of the expected code:

Code: [Select]
result = IF(Index = 0; height_0; IF(Index = 1; height_1; IF(Index = 2; height_2; height_3)))
It's worth mentioning that "index" (lower case) seems to be a reserved variable and it was not mentioned anywhere in the documentation! I spent some time to figure it out. Any provided list of reserved words would be nice.

Last thing, the functions list documentation states the ">" symbol twice for the IF function description.

P.S. I can confirm the issue happens since version 1.10.2 Pro. BTW, the thread "News & Announcements" is not updated since july. Is there any other place to check when a small update comes out or its release notes?

Alexis Vaisse

  • Administrator
  • *****
  • Posts: 138
Hi Rodolfo,

Thank you very much for your feedback.

We were able to reproduce the bug.
The "=", ">=" and "<=" operators incorrectly generated a syntax error.
This is now fixed.

Indeed "index" was a reserved word. This is no longer the case.
All reserved words should be described in the documentation.

The fixes will be in Instant Terra 1.10.5. Hopefully to be released today.

And the documentation of the "IF" function was not correct. The currently supported operators are: "<=", ">=", "<", ">", "=" and "<>".
The documentation will be fixed later in a major release.

About news and announcements: all major releases are announced on our blog: https://instantterrapro.wysilab.com/blog/. You can find there the release notes for each version.
Minor releases (1.10.1, 1.10.2...) usually only contain bug fixes. Most of the time, bugs are reported in the forum and the release is announced there.

BTW we're currently improving the GPU custom node for Instant Terra 1.11. You'll be able to work on color maps, either as a separate data (an input color map and an output color map), or directly embedded in a terrain (a terrain with a color map as input and a terrain with a color map as output).
Stay tuned! :-)

Alexis Vaisse

  • Administrator
  • *****
  • Posts: 138
We've just released Instant Terra 1.10.5 with the fix.
You can download it the usual way.

Rodolfo Calabrezi

  • Jr. Member
  • **
  • Posts: 8
  • INSANE Games Sr. Technical Artist
I can confirm that the mentioned IF issues were fixed in the 1.10.5 Pro released today.

I'm looking forward to the Instant Terra 1.11, color maps in scripts are really awaited.

Thanks for your amazing support! :0D