[Papervision3D] how to "lock down" ShadedMaterial
Carlos Lunetta
carlos.lunetta at gmail.com
Thu Jan 31 13:47:41 PST 2008
If the geometry is dynamic as well, then I believe you'll have to hack a
bit to access the final bitmapData of each face... the baked wouldn't be
an option. Post again asking how can you access the bitmapData of a
calculated shading, I have no idea how to do it but Andy, Ralph and
others surely have.
Glenn Mitchell wrote:
> Hi,
>
> I'm not sure I understand 100%
>
> The geometry itself is generated dynamically, so the nothing can be
> baked prior to construction in PV.
>
> ah wait, I think I understand,
> so I guess the question is how do I calculate the degree of shading
> required.
>
> somehow from a combination of the surface normal and a light vector /
> distance
>
> I obviously know the light location, and the wall location/angle.
> I was hoping that I could somehow use the ShadedMaterial to do this
> calculation for me
> (but just the once - not on every render cycle)
>
>
> thanks,
> g
>
>
>
>
>
> On 31/01/2008, at 10:48 PM, papervision3d-request at osflash.org
> <mailto:papervision3d-request at osflash.org> wrote:
>
>> Date: Thu, 31 Jan 2008 09:47:55 -0200
>>
>> From: Carlos Lunetta <carlos.lunetta at gmail.com
>> <mailto:carlos.lunetta at gmail.com>>
>>
>> Subject: Re: [Papervision3D] how to "lock down" ShadedMaterial (nudge)
>>
>> To: papervision3d at osflash.org <mailto:papervision3d at osflash.org>
>>
>> Message-ID: <47A1B56B.7040106 at gmail.com
>> <mailto:47A1B56B.7040106 at gmail.com>>
>>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>>
>> Hi Glenn
>>
>>
>> 1) Create the baked textures in grayscale;
>>
>> 2) Before applying the dynamic texture to the object, apply a BitmapData
>>
>> calculation of the grayscale texture on it (as a multiply effect)
>>
>> 3) Apply the resulting bitmap to the geometry.
>>
>>
>> To create the baked textures in papervision, you'll need to hack the
>>
>> shader a bit... for me it's easier to create the shading in a 3d app.
>>
>>
>>
>>
>>
>>
>> Glenn Mitchell wrote:
>>
>>>
>>> Hi Brad,
>>>
>>>
>>> thanks for the reply,
>>>
>>>
>>> yeah, that would normally be the best option,
>>>
>>> but unfortunately the building definition and the movieclip textures
>>>
>>> are all being dynamically generated from loaded data at runtime.
>>>
>>>
>>>
>>> g
>>>
>>>
>>>
>>>>
>>>> Date: Thu, 31 Jan 2008 08:46:47 +0200
>>>>
>>>>
>>>> From: Brad Roodt <brad at rustpunk.co.za <mailto:brad at rustpunk.co.za>
>>>> <mailto:brad at rustpunk.co.za>>
>>>>
>>>>
>>>> Subject: Re: [Papervision3D] how to "lock down" ShadedMaterial (nudge)
>>>>
>>>>
>>>> To: papervision3d at osflash.org <mailto:papervision3d at osflash.org>
>>>> <mailto:papervision3d at osflash.org>
>>>>
>>>>
>>>> Message-ID: <47A16ED7.2080308 at rustpunk.co.za
>>>> <mailto:47A16ED7.2080308 at rustpunk.co.za>
>>>>
>>>> <mailto:47A16ED7.2080308 at rustpunk.co.za>>
>>>>
>>>>
>>>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>>>
>>>>
>>>>
>>>> Hi Glenn,
>>>>
>>>>
>>>>
>>>> If you need fixed lighting on your object, why not create and light
>>>> your
>>>>
>>>>
>>>> building in an app like blender/swift3d/studiomax/softImage etc, bake
>>>>
>>>>
>>>> the textures and lighting there, and then export collada file for use
>>>>
>>>> in pv?
>>>>
>>>>
>>>>
>>>>
>>>> Glenn Mitchell wrote:
>>>>
>>>>
>>>>> Sorry everybody,
>>>>>
>>>>>
>>>>>
>>>>> I'm sure nudging this is really rude
>>>>>
>>>>>
>>>>> I did wait a few of days though ;)
>>>>>
>>>>>
>>>>>
>>>>> I guess the other option is just to calculate it manually from
>>>>>
>>>>>
>>>>> surface normals when the wall is first constructed and do some color
>>>>>
>>>>>
>>>>> effect / transform ?
>>>>>
>>>>>
>>>>> umm, how would I then go about finding the normal of a plane ?
>>>>>
>>>>>
>>>>>
>>>>> thanks,
>>>>>
>>>>>
>>>>> g
>>>>>
>>>>>
>>>>>
>>>>> Hi all,
>>>>>
>>>>>
>>>>>
>>>>> I've constructed a building from planes,
>>>>>
>>>>>
>>>>> and am using a PointLight3D to shade the surfaces
>>>>>
>>>>>
>>>>> the lightsource does not move, nor does the building...
>>>>>
>>>>>
>>>>> I was hoping that there was some way to avoid the recalculation of
>>>>>
>>>>>
>>>>> the shading everytime I render the scene?
>>>>>
>>>>>
>>>>>
>>>>> mvmaterial:MovieMaterial = new MovieMaterial(material_mc, 1, 0, 1);
>>>>>
>>>>>
>>>>> wallShader:FlatShader = new FlatShader(thelight, 0xFFFFFF,0x303030);
>>>>>
>>>>>
>>>>> shadedMat:ShadedMaterial = new ShadedMaterial(mvmaterial, wallShader);
>>>>>
>>>>>
>>>>> plane:Plane = new Plane(shadedMat,newWall.wid, newWall.hig,1,1);
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> thanks, in advance, to all you brainiacs :)
>>>>>
>>>>>
>>>>> glenn
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>>
>>>>>
>>>>> Papervision3D mailing list
>>>>>
>>>>>
>>>>> Papervision3D at osflash.org <mailto:Papervision3D at osflash.org>
>>>>> <mailto:Papervision3D at osflash.org>
>>>>>
>>>>>
>>>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>>>>
>>>>>
>>>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>> _______________________________________________
>>>
>>> Papervision3D mailing list
>>>
>>> Papervision3D at osflash.org <mailto:Papervision3D at osflash.org>
>>>
>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>>
>>>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20080131/4dda7cd9/attachment-0001.html
More information about the Papervision3D
mailing list