Lua script for texture animation?

Forums: Lua script for texture animation?
Forum for OctaneRender Lua scripting examples, discussion and support.

Re: Lua script for texture animation?

Postby grimm » Tue Dec 09, 2014 2:03 am

grimm Tue Dec 09, 2014 2:03 am
Excellent! Glad it works. :) On adding in the texture node stuff, I'm going to have to look in to it. I'm thinking that some of that functionality, like the UV transform can be taken care of by hooking up a transform node between the script node and what you are plugging it into. Other items I'm not sure about, ideally the texture node could have an input pin that accepts an image instead of loading it externally. Kind of an input override pin?
Linux Mint 20 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 460.56
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1321
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Re: Lua script for texture animation?

Postby Rikk The Gaijin » Tue Dec 09, 2014 4:53 am

Rikk The Gaijin Tue Dec 09, 2014 4:53 am
grimm wrote:ideally the texture node could have an input pin that accepts an image instead of loading it externally.

That would be perfect.
Rikk The Gaijin
Licensed Customer
Licensed Customer
 
Posts: 1528
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

Re: Lua script for texture animation?

Postby grimm » Tue Dec 09, 2014 6:59 am

grimm Tue Dec 09, 2014 6:59 am
Well, it doesn't quite work that way, but maybe this will work for you. I have only added a UV transform pin but I can add other image texture options. Which ones did you need?

Here is the updated script and an example image:

anim_texture.lua
(2.15 KiB) Downloaded 542 times


at_transform.png
Linux Mint 20 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 460.56
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1321
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Re: Lua script for texture animation?

Postby Rikk The Gaijin » Tue Dec 09, 2014 7:32 am

Rikk The Gaijin Tue Dec 09, 2014 7:32 am
Great! But I also need the Invert button, and then it should be perfect! 8-)
Rikk The Gaijin
Licensed Customer
Licensed Customer
 
Posts: 1528
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

Re: Lua script for texture animation?

Postby grimm » Tue Dec 09, 2014 7:43 am

grimm Tue Dec 09, 2014 7:43 am
Here you go: :D

anim_texture.lua
(2.27 KiB) Downloaded 1046 times
Linux Mint 20 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 460.56
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1321
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Re: Lua script for texture animation?

Postby Rikk The Gaijin » Wed Dec 10, 2014 5:52 am

Rikk The Gaijin Wed Dec 10, 2014 5:52 am
You are the best! 8-)
Rikk The Gaijin
Licensed Customer
Licensed Customer
 
Posts: 1528
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

Re: Lua script for texture animation?

Postby blobbybarack » Thu Dec 11, 2014 9:14 am

blobbybarack Thu Dec 11, 2014 9:14 am
Oh god yes !!!
Should be set as a default script in the next release.
Good job.
blobbybarack
Licensed Customer
Licensed Customer
 
Posts: 250
Joined: Sun Feb 03, 2013 9:11 pm
Location: Paris

Re: Lua script for texture animation?

Postby Rikk The Gaijin » Thu Dec 11, 2014 10:04 am

Rikk The Gaijin Thu Dec 11, 2014 10:04 am
blobbybarack wrote:Oh god yes !!!
Should be set as a default script in the next release.
Good job.

Agree! I hope it will. 8-)
Rikk The Gaijin
Licensed Customer
Licensed Customer
 
Posts: 1528
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

Re: Lua script for texture animation?

Postby ParviainenArk » Fri Dec 12, 2014 8:15 am

ParviainenArk Fri Dec 12, 2014 8:15 am
Both of the scripts posted here work great (Thanks stratified and grimm!), but I encounter a problem when trying to use the scripts to animate a HDRi environment. I'm using the HDRi Sky Capture sequence by Paul Debevec et al (http://gl.ict.usc.edu/Data/skyprobes/), which allows for a fully animated day cycle from sunrise to sunset - just under 700 frames of HDRi sky domes. I'm loading the HDRi sequence using the animated texture script, and feeding that into my Texture Environment. It all works great except for the fact that the script seems to load the HDR textures as LDR images.

Attached are 3 image files that illustrate the problem. The first one is a single frame render with a skyprobe EXR file fed into the Texture Environment. The HDRi has a wide enough range so that the sun casts a sharp shadow, producing a very realistic outcome.
hdr_anim_test_01.png

The second image is the result when the exact same EXR is fed into the Animated Texture script (both stratified and grimm's scripts produce identical results). The overall lighting is much darker, and the shadow is nowhere near as sharp.
hdr_anim_test_02.png

I suspected that the image is loaded as an LDR texture, so I made a test and saved the EXR as an 8-bit JPG and fed that to the Texture Environment; The result can be seen in the third attachment. I'm not sure if this is indeed the problem since I needed to set the Gamma to 5.0 to produce a similar result as the Animated Texture script.
hdr_anim_test_03.png


So, is there anything anyone can do about that? Being able to play back an HDR image sequence as a Texture Environment would be great for animations. If you're curious, just download the HDR Sky Capture sequence from http://gl.ict.usc.edu/Data/skyprobes/ and see for yourself how awesome it looks to have clouds rolling and sunlight shifting and changing while your animation runs! :D
ParviainenArk
Licensed Customer
Licensed Customer
 
Posts: 11
Joined: Fri Oct 31, 2014 10:40 am

Re: Lua script for texture animation?

Postby Rikk The Gaijin » Fri Dec 12, 2014 8:45 am

Rikk The Gaijin Fri Dec 12, 2014 8:45 am
Wow! That's actually a great idea! Grimm, can you take a look and fix the image loader to support HDR?
Rikk The Gaijin
Licensed Customer
Licensed Customer
 
Posts: 1528
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan
PreviousNext

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 4 guests

Tue Apr 16, 2024 6:13 pm [ UTC ]