avoitishin / xray-16

XRAY 16 Engine Modifications
Other
10 stars 6 forks source link

Sun direction fix #6

Closed avoitishin closed 9 years ago

avoitishin commented 9 years ago

Swartz27: Instead of just the sun direction fix, allow for working sun_altitude and sun_longitude commands. Although the sun direction fix works, it doesn't fully work with Atmosfear 3. The modified dll originally used with Atmosfear 3 enabled usage of those two commands which is how he was able to set the sun and moon direction and longitude. You can see an example of the sun direction fix not working the best as the moon doesn't ever show up with it, due to the lack of those two commands. To give you a push in the right direction, the fixed dll's he used for this were only the render dll's, so something needs to be corrected there.

avoitishin commented 9 years ago

Can you clarify whether you need these commands to configure or to use Atmosfear 3 mod? I am asking this because I've used Atmosfear 3 a lot with my own DLL that has same simple direction fix and I don't recall any issues with it. Also don't remember seeing any references to these commands in Atmosfear scripts when integrating it into my scripts.

Let me know and in meanwhile i will do some tests on my own to refresh my memory

ghost commented 9 years ago

There aren't any issue per-se, but the sun is not where it should be located according to the Atmosfear 3 parameters. The most apparent sign of this is the lack of the moon at night.

There is no reference in the scripts, it's all in configs/environment\weathers. sun_altitude and sun_longitude do not work correctly in DX9-11 by default, there is something that needs to be enabled in the render dll's apparently. Cromm Cruac does not know how this stuff works, he only knows that he used dll's that implemented these two commands for DX9-11 which worked great for sun and moon.

The sun direction fix adds the sun to the correct side of the sky, but other than the moon a good show of how it's not working correctly is how during sunset and sunrise the sun is not where the author intended it to be.

avoitishin commented 9 years ago

This is what is in code right now:

// if (config.line_exist(m_identifier.c_str(),"sun_altitude"))
    sun_dir.setHP(
        deg2rad(config.r_float(m_identifier.c_str(), "sun_altitude")),
        deg2rad(config.r_float(m_identifier.c_str(), "sun_longitude"))
        );
    R_ASSERT(_valid(sun_dir));
    // else
    // sun_dir.setHP (
    // deg2rad(config.r_fvector2(m_identifier.c_str(),"sun_dir").y),
    // deg2rad(config.r_fvector2(m_identifier.c_str(),"sun_dir").x)
    // );

So technically it should work as intended. Any way you can verify if this is working?

ghost commented 9 years ago

I'll mess around with the weather configs to see if I can get the sun to move where I want it via those variables and post back with the results. According to Cromm Cruac they do work under DX8, but don't under any other mode.

avoitishin commented 9 years ago

@Swartz27 confirm whether this is still relevant

ghost commented 9 years ago

It is, but I need to confirm what Cromm said in that it works in DX8 but not other modes. Sorry for taking so long to get around to such a simple task but I will do it soon and get back to you.

I mean, the current system works, it's just not 100% perfect to me as when the sun sets it's not quite where it should be, and I never get to see the moon anymore.

ghost commented 9 years ago

Proof, DX8, moon shows up in correct location: http://imgur.com/mkWiTfx DX9-11, moon vanishes: http://imgur.com/gjxlyfW

Conclusion: sun_altitude and sun_longitude only work in DX8. The reason Atmosfear 3 corrects this in R2-R4 binaries is this is where the correction must be made.

avoitishin commented 9 years ago

Restored sun movement as defined in weather configs in 6f60d473395c4be6391bae811950226d0bd0ebec. @Swartz27 please confirm

ghost commented 9 years ago

It works! :D

You da man.