mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
add rain noise & add rain splashes (WIP)
This commit is contained in:
parent
8dfc948fe3
commit
7635fdf807
18 changed files with 118 additions and 16 deletions
|
|
@ -92,14 +92,11 @@ static UVRegion calc_uv(
|
|||
return {u1, v1, u1 + m * scale, v1 + FACE_SIZE.y * scale};
|
||||
}
|
||||
|
||||
void PrecipitationRenderer::render(const Camera& camera, float delta) {
|
||||
void PrecipitationRenderer::render(
|
||||
const Camera& camera, float delta, const WeatherPreset& weather
|
||||
) {
|
||||
timer += delta;
|
||||
|
||||
WeatherPreset weather {};
|
||||
auto& fall = weather.fall;
|
||||
fall.vspeed = 2.0f;
|
||||
fall.texture = "misc/rain";
|
||||
|
||||
const int radius = 6;
|
||||
const int depth = 12;
|
||||
|
||||
|
|
@ -116,7 +113,7 @@ void PrecipitationRenderer::render(const Camera& camera, float delta) {
|
|||
}
|
||||
|
||||
batch->begin();
|
||||
auto& texture = assets.require<Texture>(fall.texture);
|
||||
auto& texture = assets.require<Texture>(weather.fall.texture);
|
||||
texture.setMipMapping(false);
|
||||
batch->setTexture(&texture, {});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue