Hey guys. I’m very new to Urho and Im only using Urhosharp.
Since I cant really get any interface working, Im just coding everything and trying that out. Since Im experienced with using the Unity engine and C#, this worked for me, until I had to implement a new shader…
I have never coded a shader myself and I only got one shader working in Uhro from a tutorial I found. Tutorial
So I translated the shader I need to implement into HLSL and tried to implement it but nothing worked. Maybe you guys can help me.
SInce some hardwares/drivers/API allow it, it doesn’t work in general. Urho shareds are low-level (comparing to Unity), so you have to provide both vertex and pixel shaders. Usually some clever copypaste is enough.
So now I just wanna implement any shader into the game and go from there, so I copied the LitSolid shader, renamed it and created the technique, aswell as the material file.
When Im trying to put that new material on my object, the editor breaks. When Im using the old material (which is basically all the same except for the shader name in the technique file and the technique name in the material file) it works.
Since I couldn’t get the editor working and I’m using UhroSharp, I’m coding everything in Visual Studio and running my app from there.
Because of that I also don’t have any error message, other than a unhandled exception debug break. That’s what I meant.
It can’t be some error in the shader, since it’s an exact copy of the build in LitDiffuse shader…
Sorry for my lack of knowledge. Maybe I should search for some more tutorials on setting up the editor correctly.
That is whats getting called, when Im trying to build my project with the newly implemented shader. Because of this, I dont have any error messages besides that this got called.
Whats bothering me is, that I did everything the same way as in the build-in files, except for a name change of the shader file and of course the name changes in the technique and in the material file…
Oh sorry I meant when Im trying to run my project via the start button of Visual Studio.
Yes there is a “myData” folder and I also got one custom shader already implemented with this way, but it was a glsl shader. The Objects get also drawn, but without a texture, when I delete the [psdefines=“DIFFMAP”] part of my technique file.
No sadly not, just that the “Debugger.Break” function got called…
Maybe I will find out anything today. If so, I will let you know.
Thanks for showing me, but I need to develop an interactive 3D room that I can implement into Xamarin right now, so I cant really wait for something. Maybe learning C++ and using native Urho3D would be an easier option.
Just try to look at the Exception you got from the UnhandledException event, it should tell you what kind of an error you are experiencing e.g. hlsl compilation error.
UrhoSharp treats all Urho3D Log.Errors as exceptions instead of ignoring them and writing to log, but you can ignore the exception as well by setting exception.Handled = true.
Well, I don’t mean suck entirely. Urho# runtime is fine.
But C++ to C# binding generator in Urho# sucks sooo much. So untrivial. So long instructions. So environment-demanding. So hacky. I wonder if there’s at least one person except developers who managed to get it working.
@Eugene the bindings generator is messy yes but it’s logical - it was supposed to bind 90% of API and then when all corner cases are found - I was going to rewrite it.
But I am still working on it - on a clean new version with a much more clean architecture (of the binder, not of the UrhoSharp API - it should be the same) - I’ll update it once I am sure it doesn’t break API.
It relies on a patched version of clang (to provide AST of Urho3D) that works only on macOS, but I almost finished porting it to Linux and Windows (via WSL).
So stay tuned
UrhoSharp surfaced 90% of API and doesn’t add any significant overhead (if it does - tell me) .
The main issue with Urho3D I’ve been fighting with - is the fact Urho3D doesn’t work with scenarios where you need to render Urho in a subview in an existing application. Because SDL clearly sucks at it - so I had to add lots of hacks for ALL platforms to be able to do that and it was the main source of crashes. But I beleive I’ve fixed all of them and now it’s more or less stable. But everytime you guys update the SDL 3rd party - it’s a huge pain for me to merge and solve all kind of conflicts and hidden bugs when there is no SDL changes it usually takes me an hour to update all bindings and make sure everything is working, all structures have same offsets, etc.
Why is it a problem? I have issues with keybord when doing it with Urho3D, noting more.
On Windows? Yes it works on Windows pretty well - it just needs an external Window Handle.
But it doesn’t work at all on all other platforms, for example what should I do if I want to embedd urho as a UIView (or NSView for macOS) ?
TBH I thought that UrhoSharp developement was stopped long time ago…
I do not work on UrhoSharp full time (working on Mono primary), but I maintain it. E.g. I added built-in support for all AR stuff recently including ARKit, ARCore and HL
Thanks for your answer. I now found out that it is really a Shader error, although the shader is an exact copy of the LitDiffuse shader. Any suggestions why this is happening?
03-21 15:49:01.838 E/mono-rt ( 4158): [ERROR] FATAL UNHANDLED EXCEPTION: System.Exception: Failed to link vertex shader Basic(DIRLIGHT NORMALMAP PERPIXEL) and pixel shader Basic(AMBIENT DIFFMAP DIRLIGHT NORMALMAP PERPIXEL):
03-21 15:49:01.838 E/mono-rt ( 4158): L0007 Fragment shader uses a varying vTexCoord that has not been declared in the vertex shader
Thanks again for your help guys. Its very appreciated