mayingzhen / nvidia-texture-tools

Automatically exported from code.google.com/p/nvidia-texture-tools
Other
0 stars 0 forks source link

The Gamma functionality in the 2.0.7 version of TT2 doesn’t work. #121

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Ignacio,

The Gamma functionality in the current version of TT2 doesn’t work.

Most likely anything that needs the FloatImage doesn’t work since the code 
ends up using the InputImage instead.

The following code changes seemed to make it work:

==== //depot/seattle/kona/sandbox/extern/NVIDIATextureTools2/src/src/nvtt/C
ompressor.cpp#3 (text) ====

***************

*** 126,132 ****

                        // Convert linear float image to fixed image ready 
for compression.

                        void toFixedImage(const InputOptions::Private & 
inputOptions)

                        {

!                                   if (this->asFixedImage() == NULL)

                                    {

                                                nvDebugCheck(m_floatImage !
= NULL);

--- 126,132 ----

                        // Convert linear float image to fixed image ready 
for compression.

                        void toFixedImage(const InputOptions::Private & 
inputOptions)

                        {

!                                   if (this->asFloatImage() != NULL) // 
apfaffe - We should check that we have a float image, if so convert it!

                                    {

                                                nvDebugCheck(m_floatImage !
= NULL);

***************

*** 175,185 ****

                        const Image * asFixedImage() const

                        {

!                                   if (m_inputImage != NULL) 

                                    {

!                                               return m_inputImage;

                                    }

!                                   return m_fixedImage.ptr();

                        }

                        Image * asMutableFixedImage()

--- 175,186 ----

                        const Image * asFixedImage() const

                        {

!                                   // - apfaffe - switched logic to 
return the 'processed image' rather than the input!

!                                   if (m_fixedImage != NULL && 
m_fixedImage.ptr() != NULL) 

                                    {

!                                               return m_fixedImage.ptr();

                                    }

!                                   return m_inputImage;

                        }

                        Image * asMutableFixedImage()

Original issue reported on code.google.com by Alex.Pfa...@gmail.com on 23 Mar 2010 at 5:20

GoogleCodeExporter commented 8 years ago
Hey Alex, thanks for the bug report. I'm surprised nobody had noticed that 
before, I
think that code has not changed for a while. I'll take a closer look at this 
during
the weekend.

Original comment by cast...@gmail.com on 25 Mar 2010 at 1:11

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r1062.

Original comment by cast...@gmail.com on 9 May 2010 at 6:58

GoogleCodeExporter commented 8 years ago
Sorry for the long delay. Looks like you were right. I've applied your patch 
with
some minor changes. Thanks!

Original comment by cast...@gmail.com on 9 May 2010 at 7:01