-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Colored triangle (using vertex colors) renders white #894
Comments
I just tested this with 3.0 stable release, it still exists. Created a test project for it; http://dl.dropbox.com/u/197820/monogame/monogame-3.0-stable-issue894.rar Also tested develop3d and still it also effects it. |
Thanks for looking into this and reviving the issue. It's currently our main blocking issue on getting FlatRedBall on Android. |
I'll be taking further time to investigate it. |
I'm getting the same problem on Windows 8 Desktop (with OpenGL template). |
Updated. raistlinthewiz - find anything? |
This is being caused by the BasicEffect class recomputing the shader index, which is changing the technique from BasicEffect to BasicEffect_NoFog. If I set the flag FogEnabled to true it works just fine (BasicEffect.OnApply(), BasicEffect.cs:472.) Sadly I'm not sure how to actually correct this in the code. |
@tomspilman I think this issue should be closed(or revisited). The amount of work that should be done for fixing it is huge. The XNA shares one technique whereas MonoGame shares 32 technique within one BasicEffect. And as you look into
is incorrect, there must be
|
Yeah... does XNA even allow rendering of passes that are outside the current technique? It seems dangerous and unnecessary really. Switch techniques if you need to switch techniques. |
The code above draws colored triangle correctly on XNA, but it is incorrect by nature. |
Yeah... I say it is invalid even in XNA. It just happens to work. |
I have a simple-to-reproduce case where a simple triangle does not render properly. Here is the source code which can be pasted into a Game class to reproduce the error:
http://pastebin.com/HbW0PVif
This exact code in XNA 4 (on the PC) results in a triangle with the verts being red/green/yellow. On Android (specifically Motoroal Droid Razr) renders the triangle correctly for 1 frame. The next frame the triangle renders, but it renders white instead of colored. I suspect something is not being preserved in the states frame-to-frame; however in my investigation of the code it looks like we're using pixel shaders, which I'm not as familiar with in open GL - were it fixed function I may have been able to identify the issue.
Anyway, given the relatively easy repro steps I don't think it'll be hard for those more knowledgeable with OGL to figure out what's going on.
The text was updated successfully, but these errors were encountered: