Open wanderwurst opened 9 years ago
You probably did not flag the texture asset as "Root" asset in the game studio. So it's not getting included in the package as not referenced anywhere.
Hm, no, it's marked "root". Also, if it wasn't, wouldn't it fail as well when starting from Visual Studio?
Could you should how you load your asset? Do you have any error message or exception thrown?
Actually, I'm not sure if root asset are currently well supported within the scene editor and component renderer. We will have to check this.
Thanks for your feedback. @xenux The loading code is right at the beginning of the above post, in the InitializeCore implementation:
_pointLightTexture = Assets.IsLoaded("PointLight") ? Assets.Get<Texture>("PointLight") : Assets.Load<Texture>("PointLight");
I do not get any error messages or exceptions. As said, when I launch directly from VisualStudio, everything works just fine. If I use the component in ParadoxStudio though, the scene editor stops rendering. I do suspect that there is some exception thrown somewhere, but as I asked above, I am a bit lost on where I could get to see this? To me it seems that if I have any kind of bad code in a component, the scene editor just sliently discards any exceptions and stops working. Is there some kind of log I've overlooked?
@xoofx If I understand correctly, a possible workaround would be to have that texture also in use on a model or something?
Sorry I didn't understood that the problem was only in the scene editor.
FYI, you can see scene editor logs in debug log window (Help->Show debug window->Scene).
The problem is that currently when opening a scene in the editor we only build all the asset referenced by the scene (and not all the game). Since your asset is not referenced directly by your scene it can't be found. We planned to rework the scene build workflow in the editor soon and we will be careful to fix that issue at the same time. In the meantime, you can add an artificial reference to your asset in your scene as workaround to force the scene editor to build it before opening the scene. For example a reference as field of an empty script added to an entity of your scene or as texture of a null size sprite, etc... It is quite ugly but should fix the problem waiting for our proper fix.
Thanks for the information. Great to have that debug window! :-) Sorry for not being clear on the scene editor.
I am absolutely aware that this is in beta, so any workaround that works I'm fine with (there is no "ugly" in "it works" ;-) )
Am I supposed to close this issue now or should I do that when a future version implements the unreferenced asset loading?
Great thanks :)
You can keep the issue like this for the moment. We will close it when we fix it.
I am trying to create a component similar to the Sprite component, but dumbed down. All it should do is to draw pseudo light effects using the same texture all over (a circular gradient) in additive blend mode. I try to load the texture in InitializeCore() which works fine when I run the game from VisualStudio. But opening it in Paradox Studio stops the main scene from rendering there. When I remove the Assets.Load() call and instead create a square texture in memory, everything works fine.
I guess this is either some bug or I am just not supposed to use the Assets.Load() call in the Renderer. But then, when and where would I load a texture that I want to use here?
Also, I guess PStudio catches an exception on rendering and then stops. Is there some kind of logging for these exceptions that would make finding my bad code somewhat easier?
Here is my component code, just in case: Renderer
Processor
Component