MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / _initCurves

Method _initCurves

Engine/source/environment/scatterSky.cpp:927–1006  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

925}
926
927void ScatterSky::_initCurves()
928{
929 if ( mCurves->getSampleCount() > 0 )
930 return;
931
932 // Takes time of day (0-2) and returns
933 // the night interpolant (0-1) day/night factor.
934 // moonlight = 0, sunlight > 0
935 mCurves[0].clear();
936 mCurves[0].addPoint( 0.0f, 0.5f );// Sunrise
937 mCurves[0].addPoint( 0.025f, 1.0f );//
938 mCurves[0].addPoint( 0.975f, 1.0f );//
939 mCurves[0].addPoint( 1.0f, 0.5f );//Sunset
940 mCurves[0].addPoint( 1.02f, 0.0f );//Sunlight ends
941 mCurves[0].addPoint( 1.98f, 0.0f );//Sunlight begins
942 mCurves[0].addPoint( 2.0f, 0.5f );// Sunrise
943
944 // Takes time of day (0-2) and returns mieScattering factor
945 // Regulates the size of the sun's disk
946 mCurves[1].clear();
947 mCurves[1].addPoint( 0.0f, 0.0006f );
948 mCurves[1].addPoint( 0.01f, 0.00035f );
949 mCurves[1].addPoint( 0.03f, 0.00023f );
950 mCurves[1].addPoint( 0.1f, 0.00022f );
951 mCurves[1].addPoint( 0.2f, 0.00043f );
952 mCurves[1].addPoint( 0.3f, 0.00062f );
953 mCurves[1].addPoint( 0.4f, 0.0008f );
954 mCurves[1].addPoint( 0.5f, 0.00086f );// High noon
955 mCurves[1].addPoint( 0.6f, 0.0008f );
956 mCurves[1].addPoint( 0.7f, 0.00062f );
957 mCurves[1].addPoint( 0.8f, 0.00043f );
958 mCurves[1].addPoint( 0.9f, 0.00022f );
959 mCurves[1].addPoint( 0.97f, 0.00023f );
960 mCurves[1].addPoint( 0.99f, 0.00035f );
961 mCurves[1].addPoint( 1.0f, 0.0006f );
962 mCurves[1].addPoint( 2.0f, 0.0006f );
963
964 // Takes time of day and returns brightness
965 // Controls sunlight and moonlight brightness
966 mCurves[2].clear();
967 mCurves[2].addPoint( 0.0f, 0.2f );// Sunrise
968 mCurves[2].addPoint( 0.1f, 1.0f );
969 mCurves[2].addPoint( 0.9f, 1.0f );// Sunset
970 mCurves[2].addPoint( 1.008f, 0.0f );//Adjust end of sun's reflection
971 mCurves[2].addPoint( 1.02001f, 0.0f );
972 mCurves[2].addPoint( 1.05f, 0.5f );// Turn brightness up for moonlight
973 mCurves[2].addPoint( 1.93f, 0.5f );
974 mCurves[2].addPoint( 1.97999f, 0.0f );// No brightness when sunlight starts
975 mCurves[2].addPoint( 1.992f, 0.0f );//Adjust start of sun's reflection
976 mCurves[2].addPoint( 2.0f, 0.2f ); // Sunrise
977
978 // Interpolation of day/night color sets
979 // 0/1 ambient/nightcolor
980 // 0 = day colors only anytime
981 // 1 = night colors only anytime
982 // between 0 and 1 renders both color sets anytime
983
984 mCurves[3].clear();

Callers

nothing calls this directly

Calls 3

getSampleCountMethod · 0.45
clearMethod · 0.45
addPointMethod · 0.45

Tested by

no test coverage detected