I posted the details here:
http://forum.unity3d.com/viewtopic.php?p=110720#110720
I believe this to be a Unity bug. The attached shader works on the Mac in Standalone and in the Web player.
The shader works running on Vista in RenderMonkey.
But the shader doesn’t display on Vista in the Unity player.
I’ve tested a vertex color shader and that works on Vista. Just not this shader which also runs on RenderMonkey.
Here is the player so you can see for yourself:
http://tagenigma.com/qa/Unity3d/SDSTest006/SDSTest006.html
My player log does show some errors. But it’s unclear how changing a shader could cause out of memory errors on the VBO???
081213 16:18:12 ------------------------------------------------------------
081213 16:18:12 Instance starting, version 2.1.0f5_16147
081213 16:18:12 Datafile [url]http://tagenigma.com/qa/Unity3d/SDSTest006/SDSTest006.unity3d[/url]
Direct3D:
Version: Direct3D 9.0c [nvd3dum.dll 7.15.11.7824]
Renderer: NVIDIA GeForce 8600 GTS
Vendor: NVIDIA
VRAM: 512 MB
Audio devices: Generic Hardware (default: Generic Hardware)
web: load mono
web: start, src=SDSTest006.unity3d abs=http://tagenigma.com/qa/Unity3d/SDSTest006/SDSTest006.unity3d
Player: init engine
web: sucessfully initialized
081213 16:18:13 loader: start ok
web: parent window change: 2c1506 800x550
081213 16:18:13 Times: download 0.1 load 1.0
desktop: 1680x1050 59Hz; virtual: 3360x1050 at 0,0
d3d: failed to create vertex buffer of size 2097120 [out of memory]
d3d: VB or IB is null
d3d: failed to create vertex buffer of size 2097120 [out of memory]
d3d: VB or IB is null
d3d: failed to create vertex buffer of size 2097120 [out of memory]
d3d: VB or IB is null
d3d: VB or IB is null
d3d: VB or IB is null
d3d: VB or IB is null
d3d: VB or IB is null
d3d: VB or IB is null
d3d: VB or IB is null
d3d: VB or IB is null
d3d: VB or IB is null
...
...
(Firefox crashed)
I’m using the glState to access the world projection view matrix, I wonder if that fails on vista because it sounds OGL and not DX???
Instead of glstate.matrix.mvp is there a DirectX matrix for the same thing?
I’m using this as a reference. But I’m not sure how old it is.
http://forum.unity3d.com/viewtopic.php?t=7586
BTW what’s the equivalent of “matWorldInverse” and “matWorld”?
I don’t see it here either, but I could be blind.
http://unity3d.com/support/documentation/Components/SL-BuiltinStateInPrograms.html
I created a simple project with the same results.
I created a scene with a plane and referenced the custom shader. Again, the player works on the mac and not on windows.
I really need some assistance to figure out why this is the case.
Here is a link to the player.
http://tagenigma.com/qa/Unity3d/CustomShader001/CustomShader001.html
I’ve attached the source.
Thanks.
108902–4169–$customshader001_125.zip (749 KB)
Here is my windows player log. I’ve specified a “Diffuse” fallback so I should be seeing something and not “nothing”.
081215 17:32:52 ------------------------------------------------------------
081215 17:32:52 Instance starting, version 2.1.0f5_16147
081215 17:32:52 Datafile [url]http://tagenigma.com/qa/Unity3d/CustomShader001/CustomShader001.unity3d[/url]
Direct3D:
Version: Direct3D 9.0c [nvd3dum.dll 7.15.11.7824]
Renderer: NVIDIA GeForce 8600 GTS
Vendor: NVIDIA
VRAM: 512 MB
Audio devices: Generic Hardware (default: Generic Hardware)
web: load mono
web: start, src=CustomShader001.unity3d abs=http://tagenigma.com/qa/Unity3d/CustomShader001/CustomShader001.unity3d
Player: init engine
web: sucessfully initialized
081215 17:32:53 loader: start ok
web: parent window change: 401970 600x450
081215 17:32:53 Times: download 0.1 load 0.8
desktop: 1680x1050 59Hz; virtual: 3360x1050 at 0,0
I made one change to the code by specifying a valid fallback, but that’s it. The same issue is reproduced.
See attached.
108912–4170–$customshader002_534.zip (749 KB)
Aras
December 16, 2008, 7:11am
7
There’s one caveat: when writing the vertex structure (appdata in your case), you either have to specify all semantics, or no semantics. Right now you have specified some (texcoord, texcoord1, color), and left out some (vertex).
When you’re trying to mix, the vertex attributes might not bind properly on D3D. I’ll add a note in the documentation.
If I remove all semantics, or specify the one for vertex (vertex:POSITION), it seems to work. I’m not sure if it does what you want, but something is rendered
Good to know. I did have some trouble with Unity semantics. I noticed the variable names have to be named exactly as expected for the semantic to work. If I used “position : POSITION” it doesn’t work. I’ll try this and see what I find.
Great news. I added the semantic and it fixed the issue on all my shaders.
Such a small little detail!
Thanks a ton for the help.
Something like this has to be bold 30 pt font and a picture to go with it to see it.