Minecraft icon indicating copy to clipboard operation
Minecraft copied to clipboard

Use shader to render blocks

Open Jimx- opened this issue 6 years ago • 5 comments

This makes it possible to create better visual effects like lighting

Jimx- avatar Apr 22 '19 13:04 Jimx-

I'll try to test that.

r58Playz avatar Apr 22 '19 14:04 r58Playz

Works great!

r58Playz avatar Apr 22 '19 14:04 r58Playz

Thanks for fixing the block cracking, that was bugging me :) 3D Block Icons seem to work well too! I've pulled those 4 commits into master (since you pushed them to my merged python3 branch).

Block shaders is a great addition! Though there's something odd going on with the time of day; the lighting doesn't seem to line up with where the sun image is positioned, with my world appearing to be in full shadow when the sun is at high 12:00. Also when I try flying (tab) into the sky, the world becomes much brighter, so there's something odd occurring with view occlusion...

Nebual avatar Apr 23 '19 08:04 Nebual

I tidied up + slowed down the passage of time to 20m/day cycle (matching Minecraft pacing), if you want it fast like before for testing shaders, you can use python main.py --fast which brings it up to 1m/day.

I also tweaked get_sun_position() so the shader appeared to follow the visual sun, let me know if I'm misinterpreting it!

Nebual avatar Apr 23 '19 09:04 Nebual

Thanks for the comment! I'm not quite sure about the sun position because I used the same formula in sun_vertex() to calculate the sun position so the lighting should follow the visual sun... I guess there might be something wrong with the face normals passed to the shader and I'll check that.

Jimx- avatar Apr 23 '19 09:04 Jimx-