|
From: James W. W. <ja...@fr...> - 2006-05-15 19:20:23
|
"Sean McBride" <se...@ro...> wrote:
>Up to recently I've been using Quesa 1.7 from CVS of 2006-03-28. Now
>I'm trying 1.8 and now my app crashes. The code is:
>
> TQ3ShaderObject shader = Q3NULLIllumination_New();
>
> TQ3PolygonData polygon_data;
> polygon_data.numVertices = ...;
> polygon_data.vertices = ...;
> polygon_data.polygonAttributeSet = Q3AttributeSet_New();
>
> Q3AttributeSet_Add( polygon_data.polygonAttributeSet,
> kQ3AttributeTypeSurfaceShader,
> &shader );
>
>And then in E3Set::Add() (called by Q3AttributeSet_Add) this assertion fires:
>
> Q3_ASSERT( Q3Object_IsType (
> setData.attributes.surfaceShader,
> kQ3ShaderTypeSurface ) ) ;
>
>It crashes a few lines later. I'm not sure if I built 1.7 with
>assertions, but there was no crash then.
>
>Is this not the right way to add a null shader? Our goal is to add a
>null illumination shader to a polygon object.
The name kQ3AttributeTypeSurfaceShader suggests that the attribute
should be a surface shader, but an illumination shader is not a
surface shader. One way you can see that is by looking at the
indentation in Quesa.h:
kQ3ShapeTypeShader = Q3_OBJECT_TYPE('s',
'h', 'd', 'r'),
kQ3ShaderTypeSurface = Q3_OBJECT_TYPE('s',
'u', 's', 'h'),
kQ3SurfaceShaderTypeTexture = Q3_OBJECT_TYPE('t',
'x', 's', 'u'),
kQ3ShaderTypeIllumination = Q3_OBJECT_TYPE('i',
'l', 's', 'h'),
kQ3IlluminationTypePhong = Q3_OBJECT_TYPE('p',
'h', 'i', 'l'),
kQ3IlluminationTypeLambert = Q3_OBJECT_TYPE('l',
'm', 'i', 'l'),
kQ3IlluminationTypeNULL = Q3_OBJECT_TYPE('n',
'u', 'i', 'l'),
I don't think you can add an illumination shader as an attribute. I
suggest making a display group, and inserting your illumination
shader before the polygon.
--
James W. Walker, Innoventive Software LLC
<http://www.frameforge3d.com/>
|