Author Topic: General Discussion  (Read 3821622 times)

0 Members and 26 Guests are viewing this topic.

Offline lamoli

  • Hero Member
  • *****
  • Posts: 553
Re: General Discussion
« Reply #8070 on: August 14, 2016, 05:47:21 AM »
I don't know... it just worked for me right of the bat, I still have the webm movies made with it. You can just upload the png sequence and Dark (who messed with this like yesterday, or I after a review of my projects in AE) can make the required animations.

yeah loaded my pngs into AE and got .mov with alpha but cannot do webm.. need FFmpeg for that ( a good 1 )

Dark does this mean you have a working FFmpeg with working libs ? if so please zip and box it for me


Edit:
I guess what im missing is a way to test the file in chrome to find out if the transparency is working.. if you know how let me know
« Last Edit: August 14, 2016, 05:52:52 AM by lamoli »

Offline lamoli

  • Hero Member
  • *****
  • Posts: 553
Re: General Discussion
« Reply #8071 on: August 14, 2016, 06:36:14 AM »
Omg its working lol..


Only work with chrome tho even vlc cant use transparency i will link the test file in a sec :p



Edit:
Unhappy with the online BG iv found so will render 1
« Last Edit: August 14, 2016, 06:57:21 AM by lamoli »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8072 on: August 14, 2016, 06:56:33 AM »
?

You need to create two movies... One is the normal webm movie, default settings. Second is the same movie (called "mask") but you need to set png alpha channel to red channel of the movie (or do the thing that Dark does, simply setting all channels to Alpha, I think file size might be slightly bigger this way, but it's still a lot smaller than pngs).

Ren'Py will take the red channel from the mask movie and use it as an alpha channel for the first.

=========>>>
We do have auto-animation script in PyTFall as well btw. So you can just use pngs, size is the main advantage for webm with no quality loss.

=========>>>
You need the other piece of soft to make webms directly from AE, Dark mentioned it.
Like what we're doing?

Offline lamoli

  • Hero Member
  • *****
  • Posts: 553
Re: General Discussion
« Reply #8073 on: August 14, 2016, 06:58:36 AM »
?

You need to create two movies... One is the normal webm movie, default settings. Second is the same movie (called "mask") but you need to set png alpha channel to red channel of the movie (or do the thing that Dark does, simply setting all channels to Alpha, I think file size might be slightly bigger this way, but it's still a lot smaller than pngs).

Ren'Py will take the red channel from the mask movie and use it as an alpha channel for the first.

=========>>>
We do have auto-animation script in PyTFall as well btw. So you can just use pngs, size is the main advantage for webm with no quality loss.

=========>>>
You need the other piece of soft to make webms directly from AE, Dark mentioned it.


I just managed to create real webm with transparent BG without masks

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8074 on: August 14, 2016, 07:18:59 AM »
I just managed to create real webm with transparent BG without masks

That will work in Chrome and nowhere else...
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8075 on: August 14, 2016, 07:48:29 AM »
Dark does this mean you have a working FFmpeg with working libs ? if so please zip and box it for me
Of course not, I use Media Encoder with webm plugin for rendering, it covers all my needs.
I could upload Media Encoder iso to mega, I suppose  :)

I encountered a new issue while processing animations from db. Complex animations consist of multiple png sprites, for example one is a shooting bow and another its arrows falling from above.

Or one is a sequence of attacks and another is damage effect like our default shaking, ie small animation that shows how those attacks hit the target, and both those animations should be shown at the same time.

Current animation functions do not support this stuff, or maybe they do, but we lack examples how it can be done. So I'll make all suitable webms for a start, then you'll have to take a look at the coding part.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8076 on: August 14, 2016, 08:09:02 AM »
Current animation functions do not support this stuff, or maybe they do, but we lack examples how it can be done. So I'll make all suitable webms for a start, then you'll have to take a look at the coding part.

They should... and there is one of the classes where I thought that every single line of code, simple or complex was documented trouble is... I can't find it :( :)

Maybe it was the custom class of the old, Jake's BE that I've spent half a day writing an assay about.

===>>
A lot depends on the animation itself... does it need to be reversed if it is cast from the other side? Is there a part of it that needs to be reversed and part that does not? Do we handle the movement ourselves or is the animation is large enough to handle it internally.

There is simply no "standardizing" these questions, you need to understand how the BE GFX/SFX sequencing works and apply that knowledge on per (complex) animations bases.
Like what we're doing?

Offline lamoli

  • Hero Member
  • *****
  • Posts: 553
Re: General Discussion
« Reply #8077 on: August 14, 2016, 08:13:34 AM »
That will work in Chrome and nowhere else...


well if they did it it means it should be possible to to the same kind of hack even for renpy.. ( as its only a matter on knowing how to decode the img and use alpha as background )
« Last Edit: August 14, 2016, 08:23:48 AM by lamoli »

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8078 on: August 14, 2016, 08:35:21 AM »
Some animations require two or three webms at the same time. I wonder if there is a limit of how many webms can be played.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8079 on: August 14, 2016, 08:46:07 AM »
well if they did it it means it should be possible to to the same kind of hack even for renpy..

Not really. As I wrote few posts above, they were like the first and maybe the only once who went down that path. While it was supposed to be benign modification to the codec, a lot of player broke down and most of the player never went to support it.

As far as Ren'Py is concerned (most Ren'Py devs actually don't know/understand this cr@p as it is not documented anywhere):

- Actual decoding is done in "C" (programming language) land. It is just so much faster than Python that it makes sense to use even for Ren'Py, most of which is written Python.
- What we get in "Python" land is a direct result of a frame calculated in C.
- We access that frame using a "bridge" which requests it. It uses Ren'Py's sound control system for timing those requests (which is actually quite decent at handing/syncing time). Ren'Py does not use usual Python timing methods (a lot) because neither Python multi-threading, nor default timing modules can be "Rollback"/"Saving" safe, and that is something Ren'Py dev seems to be taking very serious (to an unreasonable level in my own opinion).

All of that cr@p, means that we do not have control of the direct decoding process and cannot modify it. Last I coded in C (C++ to be precise) was like 3 years ago. I never wrote anything resembling a serious program in any C language (except C#, four year ago) in my life. Still, the main problem would remain, that even if we manage to modify C decoder, we'd have to either convince to Ren'Py dev to use our version or every time upgrade for Ren'Py is released, build our own version of it.

All of that is simply not worth it... we have control of normal Ren'Py rendering and time controls and can request frames from "C" land but even that is not a simple task. So we'll have to use what is given to us by Ren'Py devs (in this case) and modify it's bases (like times the movie is looped).

=======>>
And Ren'Py can do animations from still png frames... I mean, we're using all of those animations for BE from a number of sources and they were all png to begin with. Webm simply allows custom alignment and smaller size.
Like what we're doing?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8080 on: August 14, 2016, 08:49:02 AM »
Some animations require two or three webms at the same time. I wonder if there is a limit of how many webms can be played.

Given the same frame rate, you should be able to play quite a few. You need to use different channel names I think. Rest depends on the machine you're on, I figure even a low-entry laptop (or a half decent tablet) nowadays should be able to manage 2 or 3...
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8081 on: August 14, 2016, 09:00:37 AM »
you need to set png alpha channel to red channel of the movie (or do the thing that Dark does, simply setting all channels to Alpha, I think file size might be slightly bigger this way, but it's still a lot smaller than pngs).
It probably was fine for your Cataclysm spell because it was all red, but for animations with less red such mask is less accurate than needed.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8082 on: August 14, 2016, 09:36:52 AM »
It probably was fine for your Cataclysm spell because it was all red, but for animations with less red such mask is less accurate than needed.

No... you (possibly) still misunderstand the concept. Same movie works for cataclysm (as movie and mask) because it is mostly red! There are channels in most movie formats (called RBG):

- Red
- Green
- Blue

Some, like webm, have another channel, Alpha (but there are precious few players that can read it, like Google Chrome browser).

Your first, normal movie, is just a normal webm. With three RGB channels with each pixel encoded to a value between 0 and 255 resulting in millions of variation. Second movie (mask movie), is used to handle transparency. In that movie, Green and Blue channels are ignored while Red channel is being used to determine alpha (which is an alias for transparency) for every pixel.

Now, PNG image format, supports four channels (RGBA):

- Red
- Blue
- Green
- Alpha

That last channel, also ranging from 0 - 255 (0 being fully transparent and 255 being fully opaque) determines transparency of every pixel in the image which would become a frame in the movie as you convert.

So:

As you convert PNG to webm to be used in Ren'Py, you will be using .png frames and got to do the following:

Movie one (normal webm movie):

- PNG Red ==> WEBM Red
- PNG Blue ==> WEBM Blue
- PNG Green ==> WEBM Green

Movie Two (Special ("mask") webm movie)

- PNG Alpha ==> WEBM Red


(This second movie's red channel will be used by C decoder as Alpha channel and send the final frame, made up from both movies to the Python land and Ren'Py will be able to render it using the same process it renders everything else).

=========>>>
The reason Cataclysm works is that Red channel is so distinct there so it can pretty much be used as an alpha channel without messing with channels for the second (mask) movie.

What you said you were doing is setting PNG Alpha channel to every channel of the "mask" movie but Ren'Py will ignore all channels of that Movie except Red, so you're basically adding information there which will not be used. Unless you're doing something else that accidentally works... As you claimed, you're making the first movie a normal webm and doing this for the mask (which obviously works because Red channel is exactly what it needs to be):

Movie Two (Special ("mask") webm movie)

- PNG Alpha ==> WEBM Red
- PNG Alpha ==> WEBM Blue
- PNG Alpha ==> WEBM Green


You don't need it, real alpha value ranges from 0 - 255, there can not be any merit of setting all three channels because every pixel has just one Alpha value, not three (like not one per color). If you get different results when using three channels, you're doing something weird, like custom/proprietary algorithms that Abode is using that accidentally works out but is not necessary or even has any sort of advantage.

What lamoli was doing is setting:

- PNG Red ==> WEBM Red
- PNG Blue ==> WEBM Blue
- PNG Green ==> WEBM Green
- PNG Alpha ==> WEBM Alpha


in a single file but Google Chrome Browser video player might be the only thing that can decode that, although some other soft may have caught on by now... Ren'Py will play this incorrectly...
« Last Edit: August 14, 2016, 10:11:13 AM by Xela »
Like what we're doing?

Offline lamoli

  • Hero Member
  • *****
  • Posts: 553
Re: General Discussion
« Reply #8083 on: August 14, 2016, 10:33:28 AM »
Here a test..


https://www.dropbox.com/s/8sqjmygnnn9e95t/WEBM.rar?dl=0 Run the html with chrome ( webm doesn't follow resize but you can drag it to where it should be if you do change the window size )


As for the webm itself its not a animation its a morphing from pose to pose and i asked blender to extrapolate the transitions.. but know that i see it can do all this i might make some real animations..

« Last Edit: August 14, 2016, 10:38:33 AM by lamoli »

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8084 on: August 14, 2016, 10:43:04 AM »
I think it works differently in After Effects. I set colors channels to alpha without rendering transparency. That results in black and white webm where pure white is alpha 255 and pure black is alpha 0. At this point doesn't matter which color channel is used by renpy for mask, since they all present in white color equally.

But if I disable some channels instead of including them into alpha, that might lead to not including parts of animation into the black and white webm, so renpy will not even see them.