hi there, firstly id like to say that the nuclex fonts component is very very nice, i love the quality of the output, which is why im determined to get this working properly.
to see my problem, take the tutorial as basic code and add one model to render, a decent model with a couple of textures and watch the chaos as you render your scene.
i really really really want to get this working properly. i tired encapsulating the drawstring method within a spritebatch.begin and spritebatch.end to preserve the renderstate, but it seems as though the drawstring method is changing something else which affects 3d rendering.
any ideas?
Maybe the TextManager class can do this
Outch, sorry for the late answer :)
Saving and restoring the render state each time the
DrawString()method is called would cause a severe performance impact, this is why theBitmapFontclass doesn't do this in its current state.The 1.1.0 release has a new helper
GameComponentclass, theTextManager. This class queues text drawing until the end of the frame (so it's drawn on top of everything else). This might be the ideal place to save and restore the render states, because this way, it needs to be done only once.I'll see what I can do for the upcoming 1.1.1 release!
I just lost one day of dev.
I just lost one day of dev. time because of this retarded feature. Maybe you should say that your library change the whole fcking rendering state...
Maybe you should take a...
Maybe you should take a closer look at the design of XNA. It's just not feasible to save and restore the render state just in case. And, btw, using a
SpriteBatchor any advanced rendering effect for a model would fuck up you render states just as well.Also, see this post by Shawn Hargreaves
I'll see if I can put up a big fat notice about the render state changes, but it's really something you should get used to when working with effect files.
thanks for your reply mr
thanks for your reply mr nuclex person,
i see what u r saying in your post, but i guess the question still remains is, what states are being changed to cause the rendering issues, rendering text last doesnt seem to hold any benefit in regards to the rendering problems, so i still need to know what values to set my render states to afterwards.
Here's a List
I included the effect used by Nuclex.Fonts in the post 1.0.0 releases (see
Nuclex.Fonts/Source/Effects/FontEffect.cs) The exact render states changed are:AlphaBlendEnable = trueDepthEnable = falseDepthWriteEnable = falseStencilEnable = falseCullMode = NoneThis best option to handle this would be to use the
TextManagerclass for queueing, call itsDraw()method manually (instead of adding theTextManagerto the game'sGameComponentcollection) and then reset those render states.The default values for a new graphics device are, as far as I can tell, false, true, true, false, Clockwise (in the same order as the render states indicated above).
as borat would say, "itsa
as borat would say, "itsa verry niiice"
thx :)
great:)
Thanks for your work, it's very cool!
One sidenote: the default cullmode is CullMode.CullCounterClockwiseFace.
I wrote two tiny functions that save the 4 renderstate-members and set it back - now it works like a charm:)
greets
grasmo
Post new comment