Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xGxR sets R channel to 0 instead of 255. #5

Open
fahickman opened this issue Sep 4, 2016 · 0 comments
Open

xGxR sets R channel to 0 instead of 255. #5

fahickman opened this issue Sep 4, 2016 · 0 comments

Comments

@fahickman
Copy link

DXT5nm probably isn't used much anymore, but setting the red channel to 255 instead of 0 lets you use it interchangeably with DXT1, or BC5, or whatever in the same shader. Like this:

normal.x = tex.x * tex.a;
normal.y = tex.y;
normal.z = sqrt(1 - normal.x * normal.x - normal.y * normal.y);

diff --git a/crnlib/crn_image_utils.cpp b/crnlib/crn_image_utils.cpp
index 409e675..d222a08 100644
--- a/crnlib/crn_image_utils.cpp
+++ b/crnlib/crn_image_utils.cpp
@@ -1075,7 +1075,7 @@ namespace crnlib
                   }
                   case image_utils::cConversion_To_xGxR:
                   {
-                     dst.r = 0;
+                     dst.r = 255;
                      dst.g = src.g;
                      dst.b = 0;
                      dst.a = src.r;

illwieckz added a commit to illwieckz/crunch that referenced this issue Aug 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant