Anim8or Community

General Category => Ongoing Anim8or Development => Topic started by: Steve on October 19, 2014, 08:00:37 pm

Title: PNG Support added to Build 1118, October 19, 2014
Post by: Steve on October 19, 2014, 08:00:37 pm
Check-out the PNG support in build 1118 (http://www.anim8or.com/download/preview/files/animcl1118.zip)! I downloaded the latest source and, unlike my previous attempt, it all built and integrated smoothly. I know a lot of people will be happy to see this.

---- Note: I split the discussions on PNG from the main topic. Hope I didn't mess anything up too badly!
Title: Re: Re: Current Development Release - Build 1115, October 7, 2014
Post by: Raxx on October 19, 2014, 09:09:10 pm
Hey Steve, I tried it out myself, and it loads well! But one of the biggest advantages to using PNG is the alpha channel.

When loaded as a texture, could there maybe be a check box in the Texture Mode Selector dialog to apply the PNG alpha to that channel?

When rendering, any chance of transparent backgrounds when saving as PNG (as an option)?Woo!! Poor testing lol, it does save trans background. You're da man Steve! ;)
Title: Re: Re: Current Development Release - Build 1115, October 7, 2014
Post by: cooldude234 on October 20, 2014, 12:13:26 am
kreator: Check-out the PNG support in build 1118! I downloaded the latest source and, unlike my previous attempt, it all built and integrated smoothly. I know a lot of people will be happy to see this.
YESS!!!!!!!!!!!!!!!!!!!!!!!!!!
Title: Re: Re: Current Development Release - Build 1115, October 7, 2014
Post by: kreator on October 20, 2014, 01:39:14 am
kreator: Check-out the PNG support in build 1118! I downloaded the latest source and, unlike my previous attempt, it all built and integrated smoothly. I know a lot of people will be happy to see this.
YESS!!!!!!!!!!!!!!!!!!!!!!!!!!

GOOD JOB!!..... just need to copy/paste objects in scene mode and I`ll be a very happy bunny!!
Title: Re: Re: Current Development Release - Build 1115, October 7, 2014
Post by: MvGulik on October 20, 2014, 02:14:30 am
Major changes for build 1118:
PNG Support As of build 1118 Anim8or supports reading and writing PNG files.
:) :) :)
Title: Re: Re: Current Development Release - Build 1115, October 7, 2014
Post by: johnar on October 20, 2014, 05:19:43 am
build 1118 (http://s24.postimg.org/o4uvmxwjl/Thumbs_Up_G1.gif)
 Have not used .png files, and have been reading up about them, and experimenting a little.
 Very cool. I have noticed something which may be a bug?
 In scene mode, you can render a sequence of jpeg or bmp images. Should this also be possible using the .png format?
 If yes, then theres a problem that the avi 'selection dot', does not 'unselect' when selecting png. (as it does with jpegs and bmps)
 ie: Render -> Render movie -> png. (avi stays selected, and renders as .avi)

All very cool tho Steve. (http://s6.postimg.org/p4cqdev8d/grysmile.gif)

 And thanks for fixing up that 'órientation keys not copying' thing.
Thats a biggy for Scene Mode. (http://s6.postimg.org/4y98eizkt/grywink.gif)
 
Title: Re: Re: Current Development Release - Build 1115, October 7, 2014
Post by: Steve on October 20, 2014, 01:00:39 pm
Kyle: Are there any groups in your example? I'm still not able to reproduce it with just two objects.

johnar: Yes, you should be able to output a movie as a sequence of .png files. I'll fix this.
#098-039 - Scene editor: can't output a movie to .png format files.
Title: Re: Re: Current Development Release - Build 1115, October 7, 2014
Post by: MvGulik on October 20, 2014, 01:14:16 pm
Some older Image/Movie file saving stuff. (Save-Image & Movie-Spec windows)

- When dropping just a file-name into the file-box and clicking OK, the output file is dropped into Anim8or's current active working folder. Which changes based on other file-actions in Anim8or. (probably should go to the "Image: Directory", if one is set.)
* Hitting the file: [...] button is using the "Image: Directory" as its default.
* Using a Anim8or Configuration here where every Directory-option is set to its own folder. Like: Project: "X:\An8_data\_project", etc)



Other 1118 cosmetics: just in case.
- [PNG] and [PNGA] can both be selected, as there check-boxes. Although it seems radio-buttons where intended here. (Both Image-save and Movie-spec window)
- Movie-Spec window, Image:Height box, seems to have lost its Left-border.

*nts: fixed, all*
Title: Re: Re: Current Development Release - Build 1115, October 7, 2014
Post by: captaindrewi on October 20, 2014, 01:50:25 pm
Can anyone post some examples of successful use of the .png addition to anim8or.
and how it might be used,because i'm not getting it.
What i thought i might be able to do.
say i was rendering a sphere i was expecting to output that as a .png with a transparent background.
or say i had an object i could place a .png with transparent properties as a texture to a face.
Title: Re: Re: Current Development Release - Build 1115, October 7, 2014
Post by: ronaldefarmer on October 20, 2014, 01:59:41 pm
Thanks for the PNG support! I think this is the best improvement since i started using Anim8or! Amazing work Steve!! One question though: Is it possible to make lights recognize PNG transparency when casting shadows?
Captaindrewi:Both of the images below were made with Anim8or. The top image is the texture used to make the other one. It works just like you thought. There are a few boxes you have to check to make it work.


Title: Re: Re: Current Development Release - Build 1115, October 7, 2014
Post by: thecolclough on October 20, 2014, 02:20:59 pm
Yes, you should be able to output a movie as a sequence of .png files
this will be hugely helpful for doing multi-plate compositing work in Sony Vegas.  Vegas handles transparency so much better when it's integrated into the same file as the RGB data, e.g. the way PNGs do it.  i'll try and remember to post a test video once bug #098-039 is fixed.
Title: Re: Re: Current Development Release - Build 1115, October 7, 2014
Post by: Raxx on October 20, 2014, 04:17:12 pm
Hm, is it just me, or do PNG images load inverted as textures?
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: ronaldefarmer on October 20, 2014, 11:31:49 pm
Captaindrewi and Crashdrive: The PNG texture seems to work very well for me, aside from being inverted. Here is an AN8 that I made in 1118, along with the PNG texture.


It doesn't seem to work very well in the viewer though.


Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: Steve on October 21, 2014, 12:17:34 am
ronaldefarmer: Transparency for lights is a great idea but it's not that easy. I've wanted to support that for a long time. Adding it to the ART ray-tracer is the most straightforward, and then probably the scanline renderer but only for ray-traced shadows. OpenGL is considerably more difficult.

raxx: I think I know what's happening with the inverted output. Windows and OpenGL disagree on whether the top or bottom row of pixels is #0 so I do a bit of flipping of images. I think I'm flipping the .png output when I shouldn't be. I have some investigation to do to make sure that I'm not just moving the problem around but I'm sure I'll get it fixed :-)

CrashDrive: I think I broke the transparency texture in the OpenGL views. It does seem to make the material vanish. I'm looking into it.
#098-038 - OpenGL transparency textures don't show

ronaldefarmer: Your example works in the viewer for me, alpha and all, but I can't tell if the alpha falls off smoothly at the edges or abruptly. (And thanks for the compliment :-)

Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: kreator on October 21, 2014, 02:40:14 am
Couple of Animated renders using Png transparency First one with ART other with OGL



Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: ianross on October 21, 2014, 04:40:45 am
Thank you Steve, this is fantastic for cut out animation, it makes alpha mapping easier and pngs produce better quality renders.
I wonder if it is possible to load a sequence of png files on to flat plane and have it play as movie, somebody would have to write a script for this?
This was possible with bmp files, Kreator created a video on this years ago. Kevin please can you post a link to this, it just may inspire somebody.
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: ronaldefarmer on October 21, 2014, 01:30:12 pm
Steve:


 Transparency for lights is a great idea but it's not that easy. I've wanted to support that for a long time. Adding it to the ART ray-tracer is the most straightforward, and then probably the scanline renderer but only for ray-traced shadows. OpenGL is considerably more difficult.


Ray-traced shadows in scanline would be most useful to me; most of my rendering is scanline.



Your example works in the viewer for me, alpha and all, but I can't tell if the alpha falls off smoothly at the edges or abruptly. (And thanks for the compliment :-)


Alpha does not seem to fall off smoothly in the viewer, also back side of the material is not visible but I might have some settings wrong for the material. The compliment is well deserved.
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: Steve on October 21, 2014, 03:42:36 pm
I've fixed the inverted png textures. All png images are read in inverted, including reference images and backgrounds, so all I needed to do was flip 'em after they are read :-)
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: johnar on October 21, 2014, 07:54:46 pm
Quote
I wonder if it is possible to load a sequence of png files on to flat plane and have it play as movie,

 That was one of the really cool features in 'Terranim8or'.
 The option for this in anim8or would definately be a cool addition, but in the meantime, terranim8or still does an excellent job of doing exactly that. Then saves to .an8, making an an8 file with ímaged planes loaded in order in scene mode and  ready to go. Was/is handy for a lot of things. Ie: using as guide for scene animation, and making 'moving backgrounds'

Edit: Not sure about .png files in terranim8or. Must check that out
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: kreator on October 22, 2014, 01:03:52 am
Johnar: I think that was what IanRoz was referring to.

I don`t think that Leslie enabled .png files to be loaded, have checked only jpg, bmp or gif supported.

With Leslies site now gone, I don`t imagine it will be upgraded either
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: johnar on October 23, 2014, 12:05:16 am
Cheers kreator. Wow, thats interesting. GIF support. Hmmm.

Quote
With Leslies site now gone, I don`t imagine it will be upgraded either
Had better locate and put my copies of Terranim8or into a safe place. (http://s6.postimg.org/p4cqdev8d/grysmile.gif)
 
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: Steve on October 23, 2014, 05:23:30 pm
raxx: Build 1121 fixes inverted .png files.

CrashDrive:
Quote
Also using two images (diffuse and transparency) on an object disappears in the viewport.
I've fixed a bug where materials with multiple textures were badly broken in build 1112. Check and see if built 1121 fixes your problem.

johnar: You can now output .png files when rendering a movie (but there is still an issue where you can check both RGB and RGBA simultaneously :-( )
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: cooldude234 on October 23, 2014, 06:17:31 pm
So are we going to be able to use the alpha channel in our png files?
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: Steve on October 23, 2014, 06:59:05 pm
cooldude234: Absolutely. Here's a sample using a single RGBA texture .png file that was created by an Anim8or render. The texture has a b&w image with transparency, and the material color is magenta. The three materials have their diffuse texture's Alpha Modes set to: None, Layer and Final:


Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: Steve on October 23, 2014, 11:59:46 pm
Fantastic! It was just a little copy-and-paste error that pasted the wrong OpenGL function. Darn you, copy-and-paste! :-)
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: neirao on October 24, 2014, 07:54:54 am
Great Steve!!
yes, need only work in raytracer mode.
Anim8or always in big progress!!! :)
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: Steve on October 24, 2014, 08:06:23 pm
OK in the just posted build 1122 all blend modes and alpha modes should work correctly in ART raytracing, GLSL shaders and scanline rendering. ARB shaders and OpenGL Materials mode havr a few color issues which aren't easily fixable, but the transparency is correct (and the match each other :-) ).

Here's a sample project and the outputs:
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: Steve on October 24, 2014, 08:20:18 pm
Raxx: You can do this by setting the diffuse texture's alpha mode to "Final".

Quote
When loaded as a texture, could there maybe be a check box in the Texture Mode Selector dialog to apply the PNG alpha to that channel?
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: Raxx on October 24, 2014, 08:36:04 pm
Yarr, I noticed this later, thanks for clarifying. It's not very obvious, unfortunately.

In the new 1122 build, running your (Steve's) TargetBlendModes .an8 file, it seems to take a good 30 seconds or more between each texture not found notification. It took about 5 minutes before I could actually use the program. Is there a rogue loop going on in the code when searching for textures?
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: Steve on October 24, 2014, 08:45:01 pm
That's annoying. I'm assuming that it was essentially immediate on your computer for previous builds :-)  I'll look into it.
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: Raxx on October 24, 2014, 08:53:05 pm
It seems builds 1121 and 1118 don't even notify me of missing textures. No delays, of course ;)
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: cooldude234 on October 25, 2014, 04:27:28 pm
Ah I see, now I get it. I was trying to use the alpha mode under trans texture, I didn't realize you had to set it under diffuse.
But now I question, is there a better way to lay this out to make it more clear.
Alpha under diffuse and diffuse as alpha seems a little confusing and I can see some people not getting it.
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: Steve on October 25, 2014, 07:01:58 pm
cooldude234: There are two ways to utilize transparency in textures.

1. For a RGBA diffuse texture you can use it as the diffuse texture and set the Alpha Mode to Final. This will use the RGB components for the diffuse color and the A component for transparency. By using both a diffuse color and a diffuse RGBA texture you can achieve 9 different effects. The most useful is Blend Mode = Decal and Alpha Mode = Final which is what I think that you want here. See http://www.anim8or.com/smf/index.php/topic,4985.msg36548.html#msg36548 (http://www.anim8or.com/smf/index.php/topic,4985.msg36548.html#msg36548).

2. If you don't have an RGBA texture or don't want to use a texture for the diffuse color, you can use a Transparency texture. If there is a diffuse texture, set it's Alpha Mode to None. Then add a Transparency texture. The RGB components will be averaged for the alpha value.

Note: You can set the diffuse texture's alpha mode to something other than None when you have a transparent texture as well to achieve other effects but they aren't really that different or useful and can be inconsistent between renderers (though I may someday come up with some useful additional combinations and support them consistently through).
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: cooldude234 on October 25, 2014, 10:13:54 pm
Well that's not what I meant. I meant that is was confusing to have an alpha setting in the diffuse options, and then have even more alpha settings in the trans map options (which is essentially an alpha map).
So you have an Alpha channel for your diffuse, but then you have your alpha for your transparency.
It the having of options that are essentially the same by definition by different by result/technique that I think is the confusing part.
And I was just wondering if there was a way of redoing the GUI for your texture options and your different types of textures to fix this.

I'd also like to note at this point that I think anim8or could benefit with having a less limited material editor. I like the use of layered effects and properties like in that of Carrara.
(http://www.awbenson.com/images/UV_2/figure_13.gif)
This way you could choose what you want, and what you want to be a priority in the texturing process (you can have multiple textures on the same material).
Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: Steve on October 26, 2014, 06:11:09 pm
Raxx:
Quote
in 1122 build ... it seems to take a good 30 seconds or more between each texture not found notification.
Quote
It seems builds 1121 and 1118 don't even notify me of missing textures.

#098-040 - Erratic behavior when loading a project with missing textures.

There's a bug in the code that searches sub-directories of the texture directory for images. It's fixed for the next build.

Title: Re: PNG Support added to Build 1118, October 19, 2014
Post by: thecolclough on January 21, 2015, 04:56:28 pm
this will be hugely helpful for doing multi-plate compositing work in Sony Vegas.  Vegas handles transparency so much better when it's integrated into the same file as the RGB data, e.g. the way PNGs do it.  i'll try and remember to post a test video once bug #098-039 is fixed.

i made the video several weeks ago... and then forgot to upload it.  clever me.  ::)

so, here you go.  can you spot the post-production video filters?