LitSolid(AO) missing vertex element?


#1

I’m converting the Basic Rendering Techniques sample to run on hololens. Currently have all the techniques working but two.

ERROR: Failed to create input layout for shader LitSolid(AO) due to missing vertex element(s) (HRESULT 80070057)

System.Exception: Failed to create blend state (HRESULT 80070057).

That technique is defined here: https://github.com/xamarin/urho-samples/blob/master/FeatureSamples/Assets/Data/Sample43/MatDiffAO.xml

The code using it is here: https://github.com/xamarin/urho-samples/tree/master/FeatureSamples/Core/43_BasicTechniques

Specifically: https://github.com/xamarin/urho-samples/blob/b72d055a424d0e6be825c0239683c225d29ee723/FeatureSamples/Core/43_BasicTechniques/BasicTechniques.cs#L104

As an aside, the other technique not working is the CustomShader technique which is missing the HLSL shader. Can anyone offer how to get the HLSL shader given the GLSL shader?

It’s not complex: https://github.com/xamarin/urho-samples/blob/master/FeatureSamples/Assets/Data/Shaders/GLSL/Sample43CustomShader.glsl

This sample works on other platforms.


#2

So do you need someone to convert that opengl shader to hlsl?


#3

#4

I didn’t know if there is an easy way to do it, for instance with a tool. But it looks like not.

When I get time I’ll work through it as per the link @Modanung provided.

I just wanted to get all those materials in the sample code working on hololens.

Getting to the root cause of the DiffAO material or shader issue is the more important issue because root cause of the error is not yet known, whereas the CustomMaterial related error just needs the GLSL to HLSL conversion.


#6

I wiped out the code and started fresh. Whereupon the DiffAO related object at least paints, but still throws the error about the missing vertex.

Also, modified the TechniqueCustomShader.xml file from:


<!--Sample23CustomShader.glsl-->
<technique vs="Sample43CustomShader" ps="Sample43CustomShader" vsdefines="NOUV" >
    <pass name="alpha" depthwrite="false" blend="alpha" />
</technique>

to

<!--Sample23CustomShader.glsl for open GL systems, but on D3D it will go for the HLSL file -->
<technique vs="CustomLitSolid" ps="CustomLitSolid" vsdefines="NOUV" >
    <pass name="alpha" depthwrite="false" blend="alpha" />
</technique>

Why? Because I’m just not a shader guru and don’t aspire to be one. And would just like the SharpReality c# samples to run on a hololens. And the CustomListSolid is a fairly interesting technique to view, but can’t put into words just what it is doing.


#7

Just wanted to keep the error that’s occuring:

[4] [Fri Jan 11 19:40:33 2019] ERROR: Failed to create input layout for shader LitSolid(AO) due to missing vertex element(s) (HRESULT 80070057)
System.Exception: Failed to create blend state(HRESULT 80070057). You can omit this exception by subscribing to Urho.Application.UnhandledException event and set Handled property to True.
ApplicationOptions: args -w -nolimit -x 1268 -y 720 -p “CoreData;Data” -touch -hd -landscape -portrait
[4][Fri Jan 11 19:40:39 2019] ERROR: Failed to create blend state (HRESULT 80070057)


#8

In the urho3d docs, there is this:

Inbuilt compilation defines

When rendering scene objects, t_he engine expects certain shader permutations to exist_ for different geometry types and lighting conditions. These correspond to the following compilation defines:

Vertex shader:

*** NUMVERTEXLIGHTS=1,2,3 or 4: number of vertex lights influencing the object**

Could this be what the error is referring to? There is a missing vertex light?