Please ADD support for Luminance

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
caburfoot
Posts: 22
Joined: Mon Aug 08, 2011 6:15 am

Please ADD support for Luminance

Post by caburfoot »

We have a project with which we have had to modify IImage.h, COpenGLTexture.cpp and DX??Texture.cpp in Irrlich 1.7.2 and 1.7.3. We can adjust 1.8 so we can use DirectX but we can't figure out what needs to be done in 1.8 to use Luminance (8 bit)

The changes we made in 1.7.3 were :

Code: Select all

 
 // In IImge.h line 58 :
                //! Luminosity -- declare the ECF_LUMINANCE type
    ECF_LUMINANCE,
 
// line 173 
        case ECF_LUMINANCE:
            return 8;
// line 192
         case ECF_LUMINANCE:
       
 

Code: Select all

 
// In CD3D9Texture.cpp line 290
         case ECF_LUMINANCE:
                format = D3DFMT_L8; break;
// line 301
    if (image->getColorFormat()==ECF_LUMINANCE)
        format = D3DFMT_L8;
 
 

Code: Select all

 
// In COpenGLTexture.cpp line 107
    if (image->getColorFormat()==ECF_LUMINANCE)
        format = D3DFMT_L8;
 
// line 235
             case ECF_LUMINANCE:
            colorformat = GL_LUMINANCE;
            return GL_LUMINANCE;
 
I repeat, we can introduce the Luminance in DirectX for 1.8, but cannot see the necessary changes to introduce into 1.8
You help would be greatly appreciated. We hope you see the benefits to those which need 8 bit support.

Thanks
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Please ADD support for Luminance

Post by Mel »

Can't you use any other texture format? The operations needed for a luminance texture format can be performed on larger textures in a single channel for instance, it is the same precision.

Still the diferent color formats are only used in render target textures, so in theory, you can't have a regular texture with a ECF_L8 format
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Please ADD support for Luminance

Post by hybrid »

I think we have thiese formats supported for RTTs. For general ITexture suppport we would also need IImage support, which is currently the more unsupported part.
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Please ADD support for Luminance

Post by Mel »

Would be too hard to have regular floating point textures and images?
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Please ADD support for Luminance

Post by Nadro »

This format should be supported by DDS loader for example. In v1.9 we plan to extend ITexture interface, so new color formats will be available.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Please ADD support for Luminance

Post by Mel »

You could add also support for EXR images. EXR is an open format developped by the ILM to store floating point image data, it supports 32 bit integer images, 32 bit floating point images, luminance images and 16 bit half float images, besides extra channels.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
caburfoot
Posts: 22
Joined: Mon Aug 08, 2011 6:15 am

Re: Please ADD support for Luminance

Post by caburfoot »

The PRIMARY issue, as appearently not everyone is considering the spectrum of application, is :

Using a shader with YUV format buffers.
Specifically, using 16 bit or FLOAT or other formats doesn't guarantee transposition of the U/V (it's averaged and calculated)
As I said at the top, we'd LOVE to offer our product to Irrlicht dev's when we annouce. It currently works great with Irrlicht 1.7.2/.3 with 2d and 3d with those simple mods.

Or tell me what I need to change to work with 1.8 and 8 bit Luminance (Dx works - it's the COpenGLTexture where the issue is)
Irrlicht has taught us a lot and this project started because of Irrlicht.

Thanks
Post Reply