away3d / away3d-core-fp11

Away3D engine for Flash Player 11
http://www.away3d.com
Other
640 stars 276 forks source link

Flicking triangles when in software mode #234

Closed mth4 closed 12 years ago

mth4 commented 12 years ago

Hello,

I have attached some screenshots (without any camera movements) below as the problem is easier to show than explain. In hardware mode everything is fine, but when I switch to software mode (right-click + settings) there is a lot of such problems with the most of geometries. Some of my observations:

I can send .3ds meshes and a link with an application presenting the problem, but I would prefer to send a mail. I am trying to work it out on my own, but for now with no success.

A B C D

mth4 commented 12 years ago

It probably has something to do with Cinema 4D as we make all models with it. When I disconnect (without preserving groups) problematic triangles there is no flicking. Disconnect function in Cinema makes all selected triangles have it's own vertex copies. It duplicates vertices which are shared between few triangles. It breaks normals calculations however so I can't use it.

mth4 commented 12 years ago

After 5-6 hours of searching I've finally found what is the problem. AGAL's instruction "m34" has implementation bug in the software renderer. It probably writes wrong memory address as index buffer is sometimes randomly modified during render. The only solution for now is to use "m44" instead of "m34" at least in vertex programs as I didn't made any research for fragment programs.

In Away3D that instruction appears only in DefaultScreenPass::compileGlobalPositionCode method so I would admit changing it to "m44" as it fixes everything.

I will try to construct a simple test project during next week to submit it to Flash Player's bugtracker. I can send it also to you, if you are interested.

rob-bateman commented 12 years ago

is there any update on this issue? did you manage to construct your test and is there anything more to do?

mth4 commented 12 years ago

Unfortunately, I didn't managed to do so.

Thanks for reminding me about this. I will make that project soon.

richardolsson commented 12 years ago

@rob-bateman I can take over this issue.

@mth4 Are you using a shading method that requires global positions (such as the fog method, for example)?

Are you able to provide a test case? Otherwise I'll try to create one myself, but I would really appreciate it if you already have one.

mth4 commented 12 years ago

Are you using a shading method that requires global positions (such as the fog method, for example)?

Yes, I was using some shadow map method, but point lights also use global position calculations.

It is possible that Adobe fixed that already in FP, but initial 11.0 release was bugged. I will make that test case right now.

mth4 commented 12 years ago

Ok, it's done. Apparently it is still not fixed as of FP 11.2 as flicking still appears.

How can I send that project to you?

richardolsson commented 12 years ago

@mth4 Are you using the latest version of Away3D (from the release branch here on GitHub)? Either you can upload the project somewhere (e.g. Dropbox) and write the URL here, or you can e-mail it to me at the e-mail address found on www.richardolsson.se