H-uru / korman

Blender plugin for creating ages for Cyan Worlds' proprietary Plasma engine and its open source variant, CyanWorlds.com Engine.
GNU General Public License v3.0
35 stars 17 forks source link

Water Geometries Rendering Height based on Wind Object Height. #409

Closed Traveler263 closed 2 months ago

Traveler263 commented 4 months ago

A new korman 0.16 bug has been discovered!

Apparently, Water/Waveset Geometries will now render in the age according to the height of its corresponding WIND OBJECT. Whatever wind object you have in your age that your water geometry is set to use as a reference WILL set the water geometry's height to that height, regardless of where your mesh's lip edge is actually modeled to, or if that object is an active plasma object or not within the age export. On run time, the height of the wind object WILL set the render of the geometry mesh to that height.

This also means that, in practical practice, you absolutely can set your wind object to bob up and down and it will, in turn, bob your water geometry up and down even if it's not got any parented linkage between it.

You can watch it in action here: https://youtu.be/0F63xecYhNs

image

Traveler263 commented 4 months ago

And here is the blend link.

https://drive.google.com/file/d/1D1FpwfBVI6JM_PA62ML96UQ3JR_6ZAAQ/view?usp=drive_link

dpogue commented 4 months ago

I think that was always the intention going back to the initial implementation of the waveset modifier, but there was a change in korman 0.14 that fixed some bugs around that condition and caused it to apply more consistently: https://github.com/H-uru/korman/pull/343

I think there's a valid case to be made that a wind direction object and a water height reference object should be handled as two separate inputs, but the current behaviour matches what was intended back in 2015 when wavesets were originally added.

Hoikas commented 4 months ago

I just checked the engine code, and it looks like what is being reported matches what the engine is supposed to do.... Korman just doesn't communicate that very well:

void plWaveSet7::IUpdateRefObject()
{
    if( fRefObj )
    {
        hsMatrix44 l2w = fRefObj->GetLocalToWorld();

        float h = l2w.fMap[2][3];

        float x = -l2w.fMap[0][1];
        float y = -l2w.fMap[1][1];

        fState.fWaterHeight = h;

        fState.fWindDir = hsVector3(x, y, 0.f);
    }
}

I think there's a valid case to be made that a wind direction object and a water height reference object should be handled as two separate inputs

Probably so. I think we run into a very fun time trying to combine any animations on those objects into a single ref object animation, but it's doable.

dpogue commented 4 months ago

I think we run into a very fun time trying to combine any animations on those objects, but it's doable.

yeah, I forgot that the engine uses the reference object for both wind and height... maybe it's better to just clarify in korman that it also affects water height and is not solely for wind.