Use All Available Lighting Precision For Our Maps

by ADMIN 50 views

Unlocking the Full Potential of Lighting in Our Maps

Introduction

In the world of game development, lighting is a crucial aspect that can make or break the overall experience. With the recent merge of the Daemon Engine's pull request #1557, we have reverted to the original Tremulous default settings for tr.overbrightBits and tr.mapOverbrightBits. This change has resulted in lightmap values being multiplied by 4 but clamped to the range [0, 2], effectively throwing away 1 bit of precision. In this article, we will explore two options to address this issue and unlock the full potential of lighting in our maps.

Option 1: Decrease Map Overbright Bits to 1 (Light Values Range 0-2)

One possible solution is to set the mapOverbrightBits worldspawn key to 1, matching the value of tr.overbrightBits. This option seems straightforward, but it may require additional configuration in the q3map2 tool to achieve the same results in areas with saturated lightmaps. When loading lightmaps, the renderer performs calculations like lightcolor.rgb /= ( max(lightcolor.r, lightcolor.g, lightcolor.b) / pow(2, tr.overbrightBits) for each lightmap pixel. This ensures that the lightmap values are properly scaled to prevent clipping.

However, this option may not be ideal, as it would require a compromise on the overall lighting quality. By reducing the mapOverbrightBits value, we would be sacrificing some of the precision in the lightmap values, which could lead to a less immersive experience.

The Pros and Cons of Option 1

Pros:

  • Easy to implement
  • No significant changes required to the asset/rendering pipeline

Cons:

  • Reduced precision in lightmap values
  • May require additional configuration in q3map2
  • Could lead to a less immersive experience

Option 2: Configure Maps to Increase tr.overbrightBits to 2 (Light Truly Ranges 0-4)

The second option involves configuring the maps to increase tr.overbrightBits to 2, allowing lightmap values to truly range from 0 to 4. However, this requires the implementation of issue #1589, which may be challenging with our current asset/rendering pipeline. The extensive reworking of maps to accommodate this change could be a significant undertaking, but it may be worth it for the improved lighting quality.

Maps with bright areas, such as daytime sunlight, would benefit the most from this option. By increasing the tr.overbrightBits value, we would be able to capture more nuanced lighting effects, creating a more realistic and engaging experience for players.

The Pros and Cons of Option 2

Pros:

  • Improved lighting quality
  • More nuanced lighting effects
  • Potential for a more immersive experience

Cons:

  • Requires significant changes to the asset/rendering pipeline
  • Extensive reworking of maps may be necessary
  • May be challenging to implement with our current pipeline

Conclusion

In conclusion, both options have their pros and cons, and the decision ultimately depends on the specific needs and goals of our project. If we prioritize ease of implementation and minimal changes to the asset/rendering pipeline, Option 1 may be the way to go. However, if we are willing to invest time and effort into reworking our maps and pipeline, Option 2 could provide a more immersive and engaging experience for players.

Recommendations

Based on our analysis, we recommend exploring Option 2, configuring maps to increase tr.overbrightBits to 2. While this option requires significant changes to the asset/rendering pipeline, the potential benefits to lighting quality and player experience make it a worthwhile investment.

Future Directions

To further improve lighting in our maps, we should consider the following:

  • Implementing an sRGB pipeline, which could provide more accurate and nuanced lighting effects.
  • Reworking our maps to take advantage of the increased tr.overbrightBits value.
  • Exploring additional options for improving lighting quality, such as using more advanced lighting techniques or incorporating dynamic lighting effects.

By taking a proactive approach to lighting in our maps, we can create a more immersive and engaging experience for players, setting our project apart from others in the industry.
Unlocking the Full Potential of Lighting in Our Maps: A Q&A

Introduction

In our previous article, we explored two options to address the issue of lightmap values being multiplied by 4 but clamped to the range [0, 2]. We discussed the pros and cons of each option and recommended configuring maps to increase tr.overbrightBits to 2. In this article, we will answer some of the most frequently asked questions about unlocking the full potential of lighting in our maps.

Q: What is the current state of lighting in our maps?

A: Currently, lightmap values are multiplied by 4 but clamped to the range [0, 2]. This means that we are throwing away 1 bit of precision, which can lead to a less immersive experience.

Q: Why is it necessary to increase tr.overbrightBits to 2?

A: Increasing tr.overbrightBits to 2 allows lightmap values to truly range from 0 to 4, providing more nuanced lighting effects and a more immersive experience for players.

Q: What are the benefits of increasing tr.overbrightBits to 2?

A: The benefits of increasing tr.overbrightBits to 2 include improved lighting quality, more nuanced lighting effects, and a more immersive experience for players.

Q: What are the challenges of increasing tr.overbrightBits to 2?

A: The challenges of increasing tr.overbrightBits to 2 include requiring significant changes to the asset/rendering pipeline and extensive reworking of maps.

Q: How can we implement the changes to increase tr.overbrightBits to 2?

A: To implement the changes to increase tr.overbrightBits to 2, we will need to rework our maps to take advantage of the increased value and make significant changes to the asset/rendering pipeline.

Q: What are some additional options for improving lighting quality?

A: Some additional options for improving lighting quality include using more advanced lighting techniques, incorporating dynamic lighting effects, and implementing an sRGB pipeline.

Q: Why is an sRGB pipeline important for lighting?

A: An sRGB pipeline is important for lighting because it provides more accurate and nuanced lighting effects, which can enhance the overall experience for players.

Q: How can we ensure that our maps are optimized for the increased tr.overbrightBits value?

A: To ensure that our maps are optimized for the increased tr.overbrightBits value, we will need to rework our maps to take advantage of the increased value and make significant changes to the asset/rendering pipeline.

Q: What is the timeline for implementing the changes to increase tr.overbrightBits to 2?

A: The timeline for implementing the changes to increase tr.overbrightBits to 2 will depend on the complexity of the changes and the resources available. However, we anticipate that the changes will be implemented in the near future.

Q: How can we get involved in the process of improving lighting in our maps?

A: To get involved in the process of improving lighting in our maps, you can join our development team, provide feedback on our maps, and suggest new ideas for improving lighting quality.

Conclusion

In conclusion, unlocking the full potential of lighting in our maps requires a proactive approach to addressing the current limitations of our lighting system. By increasing tr.overbrightBits to 2 and implementing an sRGB pipeline, we can provide more nuanced lighting effects and a more immersive experience for players. We hope that this Q&A article has provided valuable insights into the process of improving lighting in our maps and has encouraged you to get involved in the process.