« Return to Thread: Best way to create a ground

Re: Best way to create a ground

by apinstein :: Rate this Message:

Reply to Author | View in Thread

Cool!

Actually I think there might be a more recent patch... (attached)

Yeah, I recently re-did the patch to work more seamlessly with  
existing PV3D infrastructure.

You need to compile the lib (or src) with "-define=flash10,true".

For your project, you'll need to build 2 versions, one for Flash9 and  
one for Flash10. We use "-define= flashTargetVersion,10" to target the  
proper version and set precise as appropriate for each version.

       if (CONFIG::flashTargetVersion == 9)
       {
         // On Flash 9 we need to enable emulation of perspective-
correct texture mapping
         this.precise = true;           // reduces speed by ~40%;  
improves texturemapping for triangles at an angle to camera (edges of  
the pano). overall this is worth speed hit b/c often we have a wide  
viewer which exaggates the effect fixed by "precise"
         this.precision = 8;            // threshold for whether to  
draw extra triangles
       }
       else if (CONFIG::flashTargetVersion == 10)
       {
         // On Flash 10, we need to only turn on pricision and use our  
custom Flash 10 graphics.drawTriangles() method for achieving perfect  
perspective correction at high speed.
         this.precise = true;
         this.precisionMode = PrecisionMode.FLASH_10;
       }







Enjoy!

Alan


On Jul 1, 2009, at 10:06 AM, Damien Pegoraro wrote:

> I just tried your BitmapF10Material patch. It works great (just have  
> to think to set precise to false) . the rendering is fast and very  
> clean.
>
> That's a really great work ! Thank you !
>
> Damien (waiting for PapervisionX)
>
>
> Alan Pinstein a écrit :
>> You can drop your segments very low if you use precise.  
>> Precise=true dynamically adds triangles as needed.
>>
>> I also have written a patch for Papervision's BitmapMaterial that  
>> uses Flash 10's drawTriangles() method which provides precise  
>> texturemapping at very high speed. You can see a recent thread on  
>> this list with many more details on that topic.
>>
>> Alan
>>
>> On Jul 1, 2009, at 5:03 AM, Damien Pegoraro wrote:
>>
>>> Thanks for the reply, i had not thought about playing with precise  
>>> value !
>>>
>>> With precise on,   the render is absolutely perfect but the number  
>>> of triangles is always very high by default.
>>>
>>> I didn't knew the pixelPrecision property. Maybe setting this  
>>> value properly with a precise texture is the best solution i can  
>>> find. The first result are quite good !
>>>
>>> One strange thing ( maybe an issue )  :
>>>
>>> -------
>>> trace ( material.pixelPrecision ) outputs 8 => triangles on  
>>> scene : 1200 ;
>>> -----------
>>> material.pixelPrecision = 8 ;
>>> trace ( material.pixelPrecision ) outputs 8 => triangles on  
>>> scene : 700;
>>> --------
>>>
>>>
>>>
>>>
>>>
>>> Peter Velichkov a écrit :
>>>> Try material.precise = true;
>>>>
>>>> Cheers,
>>>> Peter
>>>>
>>>>
>>>> ----
>>>> web: http://www.creonfx.com
>>>> blog: http://blog.creonfx.com
>>>> skype: peterv-at-work
>>>> twitter: http://twitter.com/pvelichkov
>>>>
>>>> babeuf wrote:
>>>>> Hello everybody, i'm Damien , flash coder from France.
>>>>> My question is the following : what is the best way and what are  
>>>>> the tips to
>>>>> create a ground with a large textured plane for a a pv3d game.
>>>>> I m searching for long now but i can't find a really good  
>>>>> compromise.
>>>>> If i use a detailed plane (30x30 segments ) the rendering is  
>>>>> correct  but
>>>>> the number of triangles is pretty high and FPS drops down.  If i  
>>>>> use a less detailed plane ( 20x20 segments ), the number of  
>>>>> triangles
>>>>> really drops down and FPS is good, but the straights lines on my  
>>>>> texture
>>>>> don't look straight anymore.
>>>>> What are the tips to optimize a large plane preserving most of  
>>>>> the quality ?
>>>>> Thx !
>>>>
>>>> _______________________________________________
>>>> Papervision3D mailing list
>>>> Papervision3D@...
>>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>>>
>>>>
>>>
>>>
>>> _______________________________________________
>>> Papervision3D mailing list
>>> Papervision3D@...
>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>
>>
>> _______________________________________________
>> Papervision3D mailing list
>> Papervision3D@...
>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>
>>
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D@...
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org

_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org

pv3d-flash10.patch (9K) Download Attachment

 « Return to Thread: Best way to create a ground