JoeyDeVries / LearnOpenGL

Code repository of all OpenGL chapters from the book and its accompanying website https://learnopengl.com
https://learnopengl.com
Other
11.06k stars 2.8k forks source link

Why casting float to float? #124

Closed roxlu closed 6 years ago

roxlu commented 6 years ago

I guess you intended the nrSamples to be an int https://github.com/JoeyDeVries/LearnOpenGL/blob/master/src/6.pbr/2.1.2.ibl_irradiance/2.1.2.irradiance_convolution.fs#L40 ?

I'm wondering why you would cast it there; and if it would make a difference to use int/float?

JoeyDeVries commented 6 years ago

It looks like nrSamples indeed used to be an int. I'd probably just stick to a float there so the cast can be removed; no real need for int arithmetic.