Hi,

First of all, if you are using textures that are just 64x64, wouldn't
it make sense for you to merge textures into a texture atlas, to
decrease the number of textures (and thus the number of uploads that
need to happen to the GPU)?

How are you doing the comparison that concludes that your
updateTexture() is significantly slower than the normal one?

Finally, you can definitely design your own shader and plug it into
Away3D (as a "shading method" that you can apply to your materials)
but it requires that you know AGAL. Have a look at how the existing
shading methods are built for a reference on how to do this.


Cheers
/R

On Aug 23, 3:17 pm, jamie655321 <[email protected]> wrote:
> HI,
>
> I had a couple questions regarding normal maps/custom shaders.
>
> I've been trying to figure out the best way to update a
> BitmapMaterial's normalMap ( along with the texture ) per frame.  The
> current way I have been achieving this ( probably not correct ) is by
> extending the BitmapMaterial class and overriding updateTexture():
>
> override public function updateTexture():void
> {
>     super.updateTexture();
>     var normal:BitmapData = _screenPass.normalMap;
>
>     _screenPass.normalMethod.normalMap = null;
>     _screenPass.normalMethod.normalMap = normal;
>
> }
>
> This invalidates the normalMap bitmapData ok and updates, however the
> update is significantly slower in comparison to the existing
> BitmapMaterial updateTexture() method when just updating the texture.
> Is there any reason why updating normal maps would be slower, perhaps
> because the Shader Program needs to be uploaded again when modifying
> normal maps?
>
> Second question, is as i'm calculating the normal map data from a bump
> map on the CPU side of things which is really slow anyway, ideally i'd
> like to be able to create a custom shader to receive a bump/height map
> ( which is initially updated on the CPU ) as a parameter and
> recalculate the normal map on the GPU side.  Any ideas on how/if this
> is possible to integrate with the current Away3d framework so that
> you'd get a good framerate, bearing in mind i'm working on 64x64
> textured tiles with may be 10-20 max being updated/calculated per
> frame?
>
> Thanks,
>
> Jamie

Reply via email to