Comments (17)
TextureCube has never really been supported, so you're on your own here.
Verify that it works with XNA4 first, then grab apitrace and get to work.
from fna-mghistory.
MonoGame and XNA version works fine
from fna-mghistory.
Cool, now you'll just need to figure out why.
from fna-mghistory.
What happens when you add GL.BindTexture(TextureTarget.TextureCubeMap, texture.Handle);
before this line?
from fna-mghistory.
GL.GetError() returned InvalidValue
in OpenGLDevice line 864, I will create test project.
from fna-mghistory.
While you're getting that together, I've pulled some more GL calls into OpenGLDevice that might narrow it down further:
from fna-mghistory.
Test project is here: https://github.com/Vodacek/TestProjects/tree/master/TextureCube
works fine (sky is now rendered correctly), but in my main project I still have exception mentioned in my previous post
from fna-mghistory.
At this point I really strongly recommend tracing in apitrace. If we've got a minimum case for it functioning, odds are it's how OpenGLDevice handles TextureTargets.
from fna-mghistory.
apitrace file: http://t.zvb.cz/imperium/databaze/lidi/vodacek/zvb2.1.rar
Playback is very cool function :-)
from fna-mghistory.
Huh, that's really weird... I don't see a glBindTexture for CubeMapFace anywhere in the trace.
If you run the app with force set to true:
... does that do anything? The main lead I'm following is a missing TextureTarget Flush() somewhere.
from fna-mghistory.
Just for sure exception is thrown when I try to render sky:
Microsoft.Xna.Framework.Graphics.MonoGameGLException: GL.GetError() returned InvalidValue
v Microsoft.Xna.Framework.Graphics.GraphicsExtensions.CheckGLError() v C:\Users\admin\Documents\GitHub\sdl2\MonoGame\MonoGame.Framework\Graphics\GraphicsExtensions.cs:řádek 398
v Microsoft.Xna.Framework.Graphics.OpenGLDevice.FlushGLState(Boolean force) v C:\Users\admin\Documents\GitHub\sdl2\MonoGame\MonoGame.Framework\Graphics\OpenGLDevice.cs:řádek 864
v Microsoft.Xna.Framework.Graphics.GraphicsDevice.ApplyState(Boolean applyShaders) v C:\Users\admin\Documents\GitHub\sdl2\MonoGame\MonoGame.Framework\Graphics\GraphicsDevice.cs:řádek 1230
v Microsoft.Xna.Framework.Graphics.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType primitiveType, Int32 baseVertex, Int32 minVertexIndex, Int32 numVertices, Int32 startIndex, Int32 primitiveCount) v C:\Users\admin\Documents\GitHub\sdl2\MonoGame\MonoGame.Framework\Graphics\GraphicsDevice.cs:řádek 746
v Microsoft.Xna.Framework.Graphics.ModelMesh.Draw() v C:\Users\admin\Documents\GitHub\sdl2\MonoGame\MonoGame.Framework\Graphics\ModelMesh.cs:řádek 87
v VodacekEngine.SkySphere.Draw() v C:\Users\admin\Desktop\programy\devkniha\VodacekEngine\VodacekEngine\Components\SkySphere.cs:řádek 65
...
drawing code is same as in my test project: https://github.com/Vodacek/TestProjects/blob/master/TextureCube/TextureCube/TextureCube/TextureCube/Sky.cs#L68
from fna-mghistory.
At this point I'd say throw a few more GraphicsExtensions.CheckGLError()
calls in these two blocks, after each GL call:
https://github.com/flibitijibibo/MonoGame/blob/monogame-sdl2/MonoGame.Framework/Graphics/OpenGLDevice.cs#L832
https://github.com/flibitijibibo/MonoGame/blob/monogame-sdl2/MonoGame.Framework/Graphics/OpenGLDevice.cs#L137
At that point we'd at least be sure what GL call is pushing GL_INVALID_VALUE. Could be our texture target, could be a texparameter, not entirely sure.
from fna-mghistory.
Ah-ha, think I found it... found the CubeMap stuff at the end of your trace, my fault there...
So I'm almost 100% sure that the INVALID_VALUE is coming from the MaxAnistropy texparameter call; it's setting the anistropy to... 0. What.
Do you have any SamplerStates where MaxAnistropy is set to 0?
from fna-mghistory.
Yes MaxAnisotropy is 0 :-)
from fna-mghistory.
I think the fix is to replace Anistropy.Flush()
found here:
With Math.Max(Anistropy.Flush(), 1.0f)
. Does that fix it?
from fna-mghistory.
Works very well :-) Thank you again!
from fna-mghistory.
Weird, I wonder why XNA silently clamps the value like that?
In any case, this has been pushed:
from fna-mghistory.
Related Issues (20)
- shader normalmap not work HOT 3
- Can't run on machine without audio device HOT 9
- [OpenGL] VMware/VBox Support? HOT 7
- [MojoShader] MOJOSHADER_glSetVertexAttribDivisor causes 'System.AccessViolationException' on some computers HOT 3
- [Keyboard] Proposal for Keyboard.GetLayoutEXT() HOT 1
- Microsoft.Xna.Framework.Input.GamePad.INTERNAL_AddInstance throws "An element with the same key already exists in the dictionary" HOT 2
- Triangle color is wrong with fairly simple shader + access violation exception HOT 7
- Unable to load a texture (.PNG) from stream HOT 9
- Initialization order mishap HOT 3
- GraphicsDeviceManager never set in Game HOT 1
- GL Object Disposal Wrappers are not thread-safe HOT 3
- DynamicSoundEffectInstance behavior incompatible with XNA4 HOT 8
- OpenGL 3.2+ Core Profile support HOT 4
- Starting game in full screen bug HOT 8
- Null reference when disposing sound effect after checking sound device exists HOT 5
- [QUESTIONS] learning, using FNA HOT 3
- More spec-compliant Touch Support HOT 34
- FNA Binary Release HOT 1
- RasterizerState.MultiSampleAntiAlias not implemented HOT 8
- Set Render Target to Another Window HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fna-mghistory.