[Papervision3D] Shader Help Plz

Andy Zupko azupko at zupko.info
Wed Jan 2 08:56:29 PST 2008


Use a bitmapmaterial instead of a bitmapfilematerial.
I haven't gone through the code to see why BitmapFileMaterials have
problems but they do.  Then you just need to figure out the shading
problems with the cube :)

hth?

> Anyone?
>   ----- Original Message -----
>   From: slopester
>   To: papervision3d at osflash.org
>   Sent: Monday, December 31, 2007 2:07 AM
>   Subject: [Papervision3D] Shader Help Plz
>
>
>   Hi List
>
>   I'm having a play with the shaders in GreatWhite but am clearly missing
> something.
>   When I run this code, I was kinda hoping I'd get my cube shaded (with
> bitmap1 on faces) and bump mapping on the faces (based on bitmap2).
> What I actually get is no shading on cube at all (bitmap1 appears flat
> on faces).  What have I missed?
>   Hope someone can help :o)
>
>   slopes
>
>
>   CODE
>
>   {.....................
>
>   // Setup light
>     light = new PointLight3D(true);
>     light.y = 500;
>     light.x = 500;
>     light.z = -1000;
>     scene.addChild(light);
>
>   // Setup Materials
>     flatSquare = new BitmapFileMaterial ("bitmap1.jpg");
>     flatSquareBump = new BitmapFileMaterial ("bitmap2.jpg");
>     flatSquareBump.addEventListener(FileLoadEvent.LOAD_COMPLETE, ld);
>     }
>
>    private function ld(e:Event)
>     {
>   // create shader
>     var squareShader:PhongShader = new PhongShader(light, 0xFFFFFF,
> 0x303030, 20, flatSquareBump.bitmap, flatSquare.bitmap);
>   // combine shader with original material, for a shaded material
>     var squareShadedMaterial:ShadedMaterial = new
> ShadedMaterial(flatSquare, squareShader);
>
>   //  Create materials list for cube
>     matList1 = new MaterialsList();
>     matList1.addMaterial(squareShadedMaterial,"all");
>
>   // Setup objects
>     cube1 = new Cube(matList1, 800, 800, 800, 4, 4, 4);
>
>   // Setup container, add to scene
>     objContainer = new DisplayObject3D;
>     objContainer.addChild(cube1);
>     scene.addChild(objContainer);
>
>
>
>
>
> ------------------------------------------------------------------------------
>
>
>   _______________________________________________
>   Papervision3D mailing list
>   Papervision3D at osflash.org
>   http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>
>
> ------------------------------------------------------------------------------
>
>
>   No virus found in this incoming message.
>   Checked by AVG Free Edition.
>   Version: 7.5.516 / Virus Database: 269.17.12/1202 - Release Date:
> 29/12/2007 13:27
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>




More information about the Papervision3D mailing list