openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Openexr-devel] Shade me confused


From: Nafees Bin Zafar
Subject: Re: [Openexr-devel] Shade me confused
Date: Thu, 27 Mar 2003 14:13:38 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021203

Wheeeee.  It works!!!

NVRM version: NVIDIA Linux x86 nvidia.o Kernel Module 1.0-4348 Mon Mar 24 16:36:50 PST 2003

diff -r1.1 ImageViewFragShader.cpp
130c130
<     float *ptr = _floatPixels;
---
>     half *ptr = _floatPixels;
150c150
<           GL_RGBA, GL_FLOAT, _floatPixels);
---
>           GL_RGBA, GL_HALF_FLOAT_NV, _floatPixels);


diff -r1.1 ImageViewFragShader.h
92c92
<     Imf::Array<float>   _floatPixels;
---
>     Imf::Array<half>   _floatPixels;


Thanks Drew!

-n



Drew Hess wrote:

It's already there. If you look in glext.h in the Nvidia Cg SDK, you'll find this:

#define GL_HALF_FLOAT_NV                  0x140B

So if you have a half framebuffer, all you really need to do is change the
input pixel type to GL_HALF_FLOAT_NV in the glTexImage2D call (once the
bug is fixed) and it should work.

We use half to represent color channels and float for things like Z,
normals, etc.


-dwh-



On Thu, 27 Mar 2003, Nafees Bin Zafar wrote:

Are there plans for a GL_HALF_NV type? I would thing it would be at least equally natural for the main program to do the conversion to half, and explicitly specify that it's sending in half format data. Also it is plausible to imagine that an application's internal format is half, in which case there would have to be a convert to float, only for a convert back to half to occur right away in the driver.

Or am I missing something? Is comptime's internal format half, or float? Nuke uses floats.

-n

Drew Hess wrote:

It is float data that gets uploaded to the card, due to a bug in the current (as of 4290) Nvidia drivers. Once the bug is fixed, we'll be able to send half data to the card instead. It may be fixed in today's 4390 drivers on Windows, but I'm waiting for the equivalent Linux drivers to find out.

The magic conversion happens in the glTexImage2D call (the GL_FLOAT parameter specifies the input pixel type).


-dwh-


On Thu, 27 Mar 2003, Nafees Bin Zafar wrote:



Hi Drew. Looking through the ImageViewFragShader class, I see that the texel data passed into glTexImage2D() is just regular float data. The internal format spec is set to GL_FLOAT_RGBA16_NV. So where does the magic conversion to half type occur?

I am hoping that float data doesn't get transferred to the graphics card because that would transfer 16 unnecessary bits.

-n












--
Nafees Bin Zafar        address@hidden
Zarking Lunatic         310/314-2800 (x2012)
D  I  G  I  T  A  L     D  O  M  A  I  N






reply via email to

[Prev in Thread] Current Thread [Next in Thread]