Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lerp and int/float conversions
#5
This sample function in the wiki:

Code:
float lerp(float v0, float v1, float t) {
 return v0 + t * (v1 - v0);
}

Is the simplified one, it only works if the independent variable t ranges from [0,1]. What if your t goes in the range [3, 5] for example?

But you figured out well the meaning of the line you talk about: returns an index in the interval [7, 0] from the current scanline value in the range [170, vres], that is the lower portion of the screen where the palette lightening happens. Raster effects in action Smile
Reply


Messages In This Thread
Lerp and int/float conversions - by Domarius - 07-18-2018, 10:17 AM
RE: Lerp and int/float conversions - by Domarius - 07-18-2018, 08:30 PM
RE: Lerp and int/float conversions - by megamarc - 07-18-2018, 11:23 PM
RE: Lerp and int/float conversions - by Domarius - 07-19-2018, 08:00 AM
RE: Lerp and int/float conversions - by megamarc - 07-19-2018, 03:58 PM
RE: Lerp and int/float conversions - by Domarius - 07-19-2018, 09:18 PM
RE: Lerp and int/float conversions - by megamarc - 07-24-2018, 02:02 AM
RE: Lerp and int/float conversions - by Domarius - 07-24-2018, 08:34 PM
RE: Lerp and int/float conversions - by megamarc - 08-07-2018, 06:39 AM
RE: Lerp and int/float conversions - by Domarius - 08-08-2018, 06:44 AM
RE: Lerp and int/float conversions - by megamarc - 08-09-2018, 06:30 AM
RE: Lerp and int/float conversions - by Domarius - 08-20-2018, 04:50 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)