Author Topic: Animated Backgrounds?  (Read 52527 times)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Animated Backgrounds?
« Reply #135 on: December 24, 2019, 01:46:12 pm »
Version #2.85 has been released.

For me, the next step would be to be able to adjust the mesh animation on the music tempo ;)

That could be done that way to retrieve the peek level

    if (gB.channel) {
        DWORD nLevel = BASS_ChannelGetLevel(gB.channel);
        float rValue = max(LOINT(nLevel), HIINT(nLevel)) / (float)67200;
        zTrace(STRF(rValue));
    }

then we have to combine the rValue peek level with rotate[0] and rotangle to follow the music tempo.
« Last Edit: December 24, 2019, 06:07:11 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Animated Backgrounds?
« Reply #136 on: December 24, 2019, 06:37:52 pm »
then we have to combine the rValue peek level with rotate[0] and rotangle to follow the music tempo.

Easier said than done. It seems to me the sound we need to retreat to rely on isn't a peak level but low-frequency beat that sets forth the music overall tempo.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Animated Backgrounds?
« Reply #137 on: December 24, 2019, 08:42:34 pm »
I shall use exactly the same concept than with my BassBox plugins that served me well for two decades.
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Animated Backgrounds?
« Reply #138 on: December 24, 2019, 10:39:33 pm »
Hey Patrice,

Here are all the standard post-processing shaders I'm planning to include in OR v3.00.

The only minus is they cannot be chained one after another; you have to choose the one that's the best, or none at all.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Animated Backgrounds?
« Reply #139 on: December 25, 2019, 10:10:54 am »
Thank you for the head's up, i don't know if they could help to enhance our existing 3D models, but they could produce for sure fancy 2D screen shots.

What about the glowing post processing effect you worked on, two years ago?
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Animated Backgrounds?
« Reply #140 on: December 25, 2019, 12:47:27 pm »
Glow isn't so much general aesthetic post-processing, but rather a sort of specific material like metal or glass or liquid. It differs from other ordinary materials in that it is supposed to have its dedicated texture map (called glow map) and preferably an own multi-buffer shader renderer.

And it wasn't two years ago. It was less than a year ago. But then I got distracted by other sorts of general-purpose post-processing and also by various screen anti-aliasing techniques. ObjReader is still very far from overall perfection, you know...
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Animated Backgrounds?
« Reply #141 on: December 25, 2019, 02:07:11 pm »
My friend

For the fun, try this with robots2, and the attached audio file

void gl_DrawScene() {
    if (gP.bGiration || gP.bUseFPS || gP.bAnimateLights || // lights/reset animation support added
        gP.bRotation || gP.bIsLerping || gP.tCurAniBkgndShader.nShaderID) // gP.bRotation, means meta #rotate is being used
        gP.bRedraw = TRUE;
    if (!gP.bRedraw || !IsWindowVisible(gP.hGL))
        return;

    gP.bDoneRender = TRUE;

    // PAT: 12-25-2019
    if (gB.channel) {
        DWORD nLevel = BASS_ChannelGetLevel(gB.channel);
        gP.rGiroStep = max(LOINT(nLevel), HIINT(nLevel)) / (float)67200;
        //zTrace(STRF(gP.rGiroStep));
    }


    static CHAR zMsg[16];
    static DWORD nCount, nFPS;


Note: i have to do the same with individual mesh rotation.
« Last Edit: December 25, 2019, 02:51:22 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Animated Backgrounds?
« Reply #142 on: December 25, 2019, 03:27:34 pm »
void gl_DrawScene() {
    if (gP.bGiration || gP.bUseFPS || gP.bAnimateLights || // lights/reset animation support added
        gP.bRotation || gP.bIsLerping || gP.tCurAniBkgndShader.nShaderID) // gP.bRotation, means meta #rotate is being used
        gP.bRedraw = TRUE;
........

In fact that expression is extremely ugly and inefficient. All these flags should in fact be members of a union of 32 0/1 bitfields and a 32-bit BOOL, in which case that BOOL will remain TRUE for as long as at least one bitfield in it is set to 1. Then supposing the union is itself a member of gP, the check can be reduced to just one if() instead of many, i.e. speeded up at least 6 times.

And we will have yet 32-6=26 more bitfield flags reserved for possible future use. 8)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Animated Backgrounds?
« Reply #143 on: December 25, 2019, 03:39:33 pm »
Yep, that's a good suggestion!

BTW, audio sync works also now with individual mesh rotation, but it occures to me that perhaps we should have a new check box option,
to sync animation on audio.
« Last Edit: December 25, 2019, 03:43:33 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Animated Backgrounds?
« Reply #144 on: December 25, 2019, 03:42:26 pm »
The effect is cool. And yes, please add that new checkbox to optionally sync the audio and animation.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Animated Backgrounds?
« Reply #145 on: December 25, 2019, 04:11:10 pm »
The Tor bitset manipulation could be handy to reduce drastically the size of the global properties for boolean flags.
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Animated Backgrounds?
« Reply #146 on: December 25, 2019, 07:23:21 pm »
Ok, here is the full sync.zip file altogether with the new "Sync audio" check box.

Enjoy!
« Last Edit: December 26, 2019, 07:59:22 am by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Animated Backgrounds?
« Reply #147 on: December 25, 2019, 08:43:44 pm »
Thank you Patrice,

I was just out of my house for sometime...

Haha, the effect is real cool. I like it! :D

Thanks again!
« Last Edit: December 25, 2019, 09:11:46 pm by Michael Lobko-Lobanovsky »
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Animated Backgrounds?
« Reply #148 on: December 25, 2019, 11:00:07 pm »
Ahahahahahahahah!!! ;D ;D ;D ;D
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Animated Backgrounds?
« Reply #149 on: December 27, 2019, 02:05:41 pm »
Mike

1 - I think that "Sync audio" should be checked automatically when starting in "Play audio' mode.

2 - Do you think that it would it be possible to turn on #map_bump and the like, when using #billboard?

...
Patrice
(Always working with the latest Windows version available...)