Re: Octane fog problem

New Message Reply Date view Thread view Subject view Author view

JB West (jbwest@lgc.com)
Thu, 2 Mar 2000 07:58:56 -0800


Sad but true; can't use texture color tables & fog.
See caveats in "man glColorTableSGI".

JB West | jbwest@lgc.com | downsized .sig
----- Original Message -----
From: "Mark Davey" <mkd@medphys.ucl.ac.uk>
To: "info-volumizer" <info-volumizer@corp.sgi.com>
Sent: Thursday, March 02, 2000 2:16 PM
Subject: Octane fog problem

> Hi.. I have now sorted out my dithering problems on our new Octane (by
> reducing the resolution to 1024x768, which makes the screen look a
> little horrid since we have a nice 21 inch flat screen monitor and so
> now text looks very pixelated indeed... Never mind...)
> However, I now have a new problem ( is it just me that has so many
> problems? ) As part of my current application, I use glFog as a means of
> improving depth perception. Development has taken place on an Onyx2.
> Since we received our new Octane I have tried running our application on
> this platform. Everything goes well (after I fixed the dithering
> problem) EXCEPT for the GL fog. It appears that maybe lookup tables are
> not working on the Octane when fog is enabled.
>
> As an example I am including a revised Draw function to replace that
> found in voglMain.cxx
>
> If the demo program
>
> voglBasic CT.Head.Small.char.tif -sc 1 1 3.2
>
> is then run on our Onyx2 then I get a nice fog enhanced volume rendered
> image. If however I run the same code on the Octane then I simply get a
> black screen. Am I defining my fog incorrectly? Or is there some problem
> with the Octane? Or is Volumizer doing something strange if fog is
> enabled (seems unlikely)
>
> Anyway here is the code segment. I replace the usual glFrustum command
> with one of my own to help me set the fog up correctly.
>
> Regards
> Mark
>
> void
> Draw(Widget widget)
> {
>
> glEnable(GL_DEPTH_TEST);
> glClearColor(0.0, 0.0, 0.0, 1.0);
> glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
>
> float m[4][4];
> build_rotmatrix(m, cumulativeQuaternion);
>
> glMatrixMode(GL_MODELVIEW);
> glLoadIdentity();
>
>
> // Temporary changes to show fog
>
> glMatrixMode(GL_PROJECTION);
> glLoadIdentity();
> glFrustum(
> -0.0025, 0.0025, -0.0025, 0.0025, 0.01, my_Data.modelSize[2]*4);
>
> glMatrixMode(GL_MODELVIEW);
> glTranslatef(0, 0, -my_Data.modelSize[2]*3);
> glEnable(GL_FOG);
> GLfloat fogColor[4] = {0.0,0.0,0.0,0.0};
> glFogi(GL_FOG_MODE,GL_LINEAR);
> glFogfv(GL_FOG_COLOR,fogColor);
> glFogf(GL_FOG_DENSITY,0.01);
> glFogf(GL_FOG_START,my_Data.modelSize[2]*2.0);
> glFogf(GL_FOG_END,my_Data.modelSize[2]*3);
>
> // End of changes
>
>
> glMultMatrixf(&(m[0][0]));
> glRotatef(180, 0, 1, 0); // initial rotations
> glRotatef( 90, 1, 0, 0); // initial rotations
>
> glScalef(
> my_Data.modelScale[0], my_Data.modelScale[1],
> my_Data.modelScale[2]);
> glTranslatef(
> -my_Data.modelCentroid[0],
> -my_Data.modelCentroid[1],
> -my_Data.modelCentroid[2]);
>
> my_DrawVolume(my_Data.aTetraSet, my_Data.aVolume);
>
> GLwDrawingAreaSwapBuffers(widget);
>
> }
>
>
>
> --
> From: Mark Davey
> Dept. of Medical Physics, UCL.
>
> TEL: +44 (0)171 915 1673.
> FAX: +44 (0)171 837 9279.
>
> Institute of Laryngology and Otology,
> 330 Gray's Inn Road,
> London.
> WC1X 8GE.
>
>


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Thu Mar 02 2000 - 09:40:38 PST