Hi,

On Mon, 2004-05-24 at 00:27, Tobias Berghoff wrote:
> On 23 May 2004, Gerrit Voss wrote:
> 
> Hi!
> 
> > > Short question: Does the current VRML97 loader accept SFStrings (or 
> > > MFStrings)?. While the  OSGScanParseSkel.{y,lpp} certainly look that way, 
> > > I always get "WARNING: -----> parse error in Line" errors for the 
> > > strings...
> > 
> > it should could you send an example ?
> 
> With pleasure.
> I've added a ShaderAppearance node, which is derived from Appearance. 
> Looks like this:
> 
> PROTO ShaderAppearance [
>   exposedField SFNode material          NULL
>   exposedField SFNode texture           NULL
>   exposedField SFNode textureTransform  NULL
>   exposedField SFString vertexShader     ""
>   exposedField SFString fragmentShader   ""
> ] { }
> 
> As a test .wrl I use the TIE, which has a ShaderAppearance node instead of 
> the usual Appearance one:
> 
> Shape {
> appearance ShaderAppearance {
>  material Material {
>   diffuseColor 0.647059 0.647059 0.647059
>   specularColor 0.498039 0.498039 0.498039
>   emissiveColor 0 0 0
>   shininess 0.078125
>   transparency 0.000000
>  }
> 
> vertexShader
>   "cg: struct appin
>    {
>      float4 Position     : POSITION;
>      float4 Normal       : NORMAL;
>      float4 Color        : COLOR0;
>    };
> 
>    struct V2FI
>    {
>      float4 HPosition    : POSITION;
>      float3 Color        : TEXCOORD0;
>      float3 Normal       : TEXCOORD1;
>      float3 ViewVector   : TEXCOORD2;
>      float3 LightVector  : TEXCOORD3;
>    };
> 
>    V2FI main(appin IN)
>    {
>      V2FI OUT;
> 
>      float4 pos       = mul(glstate.matrix.modelview[0], IN.Position);
>      OUT.ViewVector   = -pos.xyz;
>      OUT.LightVector  = normalize(glstate.light[0].position.xyz);
>      OUT.HPosition    = mul(glstate.matrix.projection, pos);
>      OUT.Normal       = 
> normalize(mul(glstate.matrix.invtrans.modelview[0], IN.Normal).xyz);
>      OUT.Color     = IN.Color.rgb;
>      return OUT;
>    }
>   "
>
> 
> If you want the actual code, I could send you a tarball. At least from 
> my experimentation, it seems as if the ShaderAppearanceDesc-code is not 
> visited before the error appears, though.

at least the scanner/parsers are able to read you strings, I plugged
one of your strings into a normal texture url and got no errors, so the
problem must be somewhere else. So if you could send me the code I can
have a further look at it.

regards,
  gerrit




-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to