Next Steps
This is as far as we go with the tutorial, but there’s plenty more that can be done with the shader!
Issues to Fix
Transparent Entities
gbuffers_terrain
program. Entities are handled by gbuffers_entities
, which falls back to gbuffers_textured_lit
. Since we have not overriden this program, it doesn’t write our normals or lightmap data to the buffers we need it to. An easy way to resolve this is to rename gbuffers_terrain
to gbuffers_textured_lit
, which most programs we care about will fall back to. For more information, see Gbuffers.
Bright Night
Since our sunlight and skylight colors are constant, things are still very well lit at night. This can be improved by varying the skylight and sunlight colors based on the time of day. We can do this using the uniform worldTime
.
Things to Do
Here are some things you could try adding to your shader next. Some of these are more complex than others, and may require additional research into graphics programming.
- A custom sky, using a simple gradient based on the time of day, or even a physically based atmosphere
- Waving water and foliage
- Better shadow filtering, using interleaved gradient noise and a Vogel disk
- A tonemap
- Clouds
- Specular shading, using something like Blinn-Phong shading or at a more advanced level, the Cook-Torrance BRDF
- Screen Space Reflections
- Bloom
Resources
- The shaderLABS discord has some resources on shader development, but also has channels where you can ask for help if you’re stuck on something.
- Some items in this list of resources by Bálint are also useful.
- The Iris docs are incomplete, so if you can’t find something, you may be able to find it in the OptiFine Documentation or ShaderDoc.