Bug with methods use + normal specular maps. [UPDATE][ISSUE][NOTFIXED]

Software: Away3D 4.x

Shegl, Sr. Member
Posted: 01 June 2012 12:16 PM   Total Posts: 134

OK, away3d have huge bug with methods and multiply maps. How u can reach this bug:

Case 1: You use one mesh with normalmap and specular map + mesh with no normal map and specular map with Fog and Shadow methods. [Mesh material missing]

Case2: You use all meshes with normals specular maps with unique FOG and shadow method [working fine]

Case3: You use all meshes with normals specular maps with unique FOG and shadow method + TERRAIN HAVE TerrainDiffuseMethod [Register overflow!]

Case4: You use one main player mesh with normal map and specular map. You use terrain with TerrainDiffuseMethod and normal map. You use statics object with only TextureMaterial in cases:
    - You turn on Fog method for all objects [Object with diffuse method came one color and with red orb of bugging fog method].
    - You turn on Shadow Method(any of) [Terrain object or static object without normal and speculars maps are destroy their material and they makes invisible for ppl eye]


HOW TO AVOID: To avoid this huge bug u need or not use normal and specular maps or use it for all object and not using terrain diffuse method. (If you need to use fog and shadow method).


SOLVE FOR ME: So im just reject using for a while from specular maps and fog methon and now I can use TerrainDiffuse + DiffuseTexture + NormalMap and TripleShadowMethod.

[-] FogMethod, [-] SpecularMaps..

Where I can found good books or tutorials for learning AGAL?

#########################################################

 

 

 

 

 


Ok now. I have class what create dynamicly terrain from xml.

Kinda:

public function loadLevelByXML(id:String,myXML:XML):void {
init loading
...
then initObjects(getMaterial(myXML),myXML);

getMaterial code:

private function getMaterial(mXML:XML):TextureMaterial
   {
    
if(mXML.terrain[0].defusemethod{
     
var terrainMethod:TerrainDiffuseMethod = new TerrainDiffuseMethod([new BitmapTexturemain_root.UOLoader.images[mXML.terrain[0].defusemethod[0].item[0].@value].bitmapData), new BitmapTexturemain_root.UOLoader.images[mXML.terrain[0].defusemethod[0].item[1].@value].bitmapData), new BitmapTexturemain_root.UOLoader.images[mXML.terrain[0].defusemethod[0].item[2].@value].bitmapData)], new BitmapTexturemain_root.UOLoader.images[mXML.terrain[0].defusemethod[0].@splat].bitmapData) ,[111100]);
    
}
    
var terrainMaterial:TextureMaterial = new TextureMaterial(new BitmapTexture(main_root.UOLoader.images[mXML.terrain[0].@texture].bitmapData));
    if(
mXML.terrain[0].defusemethod{
     terrainMaterial
.diffuseMethod terrainMethod;
    
}
    terrainMaterial
.normalMap = new BitmapTexture(main_root.UOLoader.images[mXML.terrain[0].@normalmap].bitmapData); 
    
terrainMaterial.mipmap true;
    
terrainMaterial.ambientColor 0x303040;
    
terrainMaterial.ambient 0.5;
    
terrainMaterial.specular .2;
    
    
terrainMaterial.lightPicker main_root.game.lightPicker;
    
terrainMaterial.addMethod(main_root.game.fogMethod);
    
terrainMaterial.shadowMethod main_root.game.filteredShadowMapMethod;
    return 
terrainMaterial;
   

then adding to scene:

ground = new Mesh(new PlaneGeometry(mXML.@height 75 mXML.@width 75mXML.@heightmXML.@width), mat);
    
ground.castsShadows false;
    
ground.=  mXML.@fromy 75 +  mXML.@width 75 2;
    
ground.=  mXML.@fromx 75 mXML.@height 75 2

work perfectly but then i place on it my Character mesh with castShadows=true, terrain missing.


2 pics. First without shadow method, the second one with.

 

   

Shegl, Sr. Member
Posted: 01 June 2012 12:20 PM   Total Posts: 134   [ # 1 ]

and game class(away3d controller class) main_root.game

initEngine();
    
initLights();
   private function 
initEngine():void
   {
    view 
= new View3D();
    
scene view.scene;
    
camera view.camera;
    
camera.lens.near 20;
    
camera.lens.far 10000;
 
    
camera.= -200;
    
camera.856;
    
    
addChild(view);

    
awayStats = new AwayStats(view)
    
addChild(awayStats);
   
}

private function initLights():void
   {
  
    whiteLight 
= new DirectionalLight(-1, -0.4, -1);
    
whiteLight.color 0xffffee;
    
whiteLight.castsShadows true;
    
whiteLight.ambient 1;
    
whiteLight.diffuse 1;
    
whiteLight.specular 1;
    
scene.addChild(whiteLight);
    
    
lightPicker = new StaticLightPicker([whiteLight]);   

    
filteredShadowMapMethod = new TripleFilteredShadowMapMethod(whiteLight);
    
filteredShadowMapMethod.epsilon 0.0025;
    
fogMethod = new FogMethod(0camera.lens.far*0.50x000000);
   

 

 

   

Shegl, Sr. Member
Posted: 01 June 2012 03:51 PM   Total Posts: 134   [ # 2 ]

https://github.com/away3d/away3d-core-fp11/issues/224 same problem.. how he fix this ?

 

   

Shegl, Sr. Member
Posted: 06 June 2012 06:54 PM   Total Posts: 134   [ # 3 ]

Guys still strange problems.. Look at this
http://uoarena.ru/UOArena3D/bin/ (login admin password admin)
(for non-Russian speaking guys - Top Input Login , Bottom Input Password, Left Bottom item to continue)
Now my level work only without shadow methods and then I add gameObject (statue) to my level all looks bad.

Character MCHammer in Level 01.

And another character in level 00.
Login tester
password tester

Look not bad.. What wrong with it ? help me plz. Im confused.. newbie in 3d graphics.

 

   

Shegl, Sr. Member
Posted: 06 June 2012 07:06 PM   Total Posts: 134   [ # 4 ]

CHARACTER TO CHOOSE ON ADMIN ACCOUNT is MCHAMMER
character to choose on tester tester1 tester2 accounts is any.
passwords same as login.

 

   

Shegl, Sr. Member
Posted: 07 June 2012 07:09 AM   Total Posts: 134   [ # 5 ]

OK it’s something wrong with methods.. Fog method Shadow method.. all of them bugged. Then the scene have 5000 poly some of methods go crazy..
then I have more then 1000 poly shadow method shut down the shadow taken mesh. then > 4000 poly fog method go crazy and looks like:

 

   

Shegl, Sr. Member
Posted: 07 June 2012 07:12 AM   Total Posts: 134   [ # 6 ]

Shadow Method just destroy material of object what has been loaded early.
What im doing wrong ?

 

   

Shegl, Sr. Member
Posted: 07 June 2012 03:31 PM   Total Posts: 134   [ # 7 ]

I simulate this on clear project without any gamecontroller classes.. Just scene.. and all seems to work fine. So can u atleast tell me where I need search for this “ingame” bug ?

It’s problem with textures control, or with shaders, or with cross classes links or whatever ?

 

   

Shegl, Sr. Member
Posted: 09 June 2012 06:09 PM   Total Posts: 134   [ # 8 ]

FFS! No answer and no help.. Why ? Where I can find help ?

 

   

John Brookes, Moderator
Posted: 09 June 2012 06:39 PM   Total Posts: 732   [ # 9 ]

People cant/wont debug your game for you.
If there is an issue, then provide the most basic code example of the issue and submit a bug on github.
The devs (when they have the time) can then test and fix.

Sorry never had the issue and the only thing that maybe related is this
https://github.com/away3d/away3d-core-fp11/issues/254

 

   

Shegl, Sr. Member
Posted: 09 June 2012 08:47 PM   Total Posts: 134   [ # 10 ]

Yeah john brookes I already find this issue. But thanks. And im not asking for debuging my game.. Just searching guys who had same issue and know where are the proper way to fix this.. Nice community btw.

And then I fix in that way I got Register overflow! message..

I will try post here reproduce of bugs independent FlashDevelop Project..

 

   

Shegl, Sr. Member
Posted: 10 June 2012 08:49 AM   Total Posts: 134   [ # 11 ]

Update the first post and name of thread.

 

   

Shegl, Sr. Member
Posted: 16 June 2012 04:41 PM   Total Posts: 134   [ # 12 ]

This topic request Richard Olsson attention ^_^.

 

   

Richard Olsson, Administrator
Posted: 20 June 2012 06:04 PM   Total Posts: 1192   [ # 13 ]

Are you reusing the same method across several materials? That’s not going to work (it will produce undefined results) and it never has been expected to work. For that very reason we have recently implemented a check in the release branch that simply throws an error if you try to reuse the same shading method across several different material instances. See the following issue report, as well as the linked in issue report and commit message:
https://github.com/away3d/away3d-core-fp11/issues/95

Instead of reusing methods, you should create clones of the methods each time you assign them to a new material instance. We are planning on adding a clone() function to all shading method classes for this purpose. That addition is tracked here:
https://github.com/away3d/away3d-core-fp11/issues/300

 

   

Shegl, Sr. Member
Posted: 20 June 2012 10:47 PM   Total Posts: 134   [ # 14 ]

Thanks it’s work great now! But not tested +specular maps or objects without normal maps.

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X