+3
Fixed

OpenGL and OpenGL Shader Looks Black

Serhat Ergen 11 years ago updated by Freya Holmér (Developer) 10 years ago 28
In android profile mod, my vertex color blending shaders look black. I tried many things like changing lighting mode, disabling glossiness and other things but in OpenGL target renderer, they still look black. Even in unity and android builds.

Answer

Answer
Fixed
This seems to have been due to older versions of SF, closing this thread
Strange. How does your shader tree look? Is OpenGL ES 2.0 enabled in the shader settings?
https://dl.dropboxusercontent.com/u/409384/shaderF...

Here is my shader tree look. OpenGl ES 2.0 is not enabled on screenshot because when i enable it, it looks black. Maybe it's because of shader instruction count limit of OpenGL ES 2.0 ?
Even though i disable normal map and specular map nodes to reduce draw call, it looks black. Here is another screenshot. Sorry to mess my shader tree because of trying to pump them in single screen.

https://dl.dropboxusercontent.com/u/409384/shaderForge2.PNG
It does look a bit expensive, but, if you enable GLES as well in the shader settings, does it work on mobile after that, even though it looks black in SF?
Yes it looks black on android build with opengl 2.0 hardware too. Disabling normal maps and specular maps make it 20 instructions but didn't help.
That's very weird :(
If you make a simple diffuse shader then? Plug in a value of 1 into diffuse, disconnect the rest from the main node - will it work?
Seems like quite a serious issue.

1. Could it be that you have no dynamic lights in your scene, and you aren't baking lightmaps?
2. Which Unity version are you running?
3. Are you 100% sure the material is using the same shader you're working on?
1. I have one directional light on my scene. I baked some directional lights to test it but all of them look still black. Weirdest thing is in OpenGL ES 1.1 emulation, all Shader Forge shaders look black. But when i return to 2.0 one is still black and other looks good in viewort. (Even though it still looks black in preview of shader forge). If i try to open that shader in shader forge again it stops looking black in viewport but not it build. Probably unity viewport bug here about emulation.

2. I'm using 4.2.2f1.

3. Yes, i'm sure both of my shaders and new only diffuse shader attached to new material and attached to new sphere on scene but it still looks black. In all light modes(Unlit, Blinn-Phong, Phong)
I' tried almost all settings in shader forge to disable and enable. I tried to edit shader file and delete pragma target 3.0. But no luck.

It can't be im still using Shader Forge version 0.17 right? I didn't want to update it without solving this problem.
It *might* be, but I doubt it.
Are you running deferred or forward rendering?
 I switched the platform to android. It's forward rendering. I even forced camera settings to render in forward. But its still black. I think it will be easier to understand what causes this problem if i send you a package at least.

https://dl.dropboxusercontent.com/u/409384/blackSh...

It seems to work fine on my end.
Is it only this shader or all shaders? If you make an entirely new project, a new scene, import SF, and make a simple diffuse shader, does it work?

Almost all the render platforms were disabled in that package, are you sure the shader compiled after you enabled platforms? (You may have to click the compile shader button manually)
I've got 2 shaders on my scene. Other one is a little bit heavier this. I'll try to make a new project and import everything to that one. I'm disabling some render platforms to see it works on viewport or not. Because in pc platform they still render in DX9 in viewport. Actually we tried it 2 computers, one is being used for android game development and we get build from that computer but, they were still black. Thanks for feedback. I'll try it with new project now.
Made a new project and tried 3 shaders that created with shader forge. One is still black probably because instruction count exceeds 75 in GLES 2.0. Thanks for the support.
-1
Ah, is that a hard limit for GLES? Perhaps I should add a warning if that's the case
http://docs.unity3d.com/Documentation/Components/SL-ShaderPrograms.html

Here is shader target limits for each 2.0 and 3.0. I'm passing the limit but i don't know, is it from arithmetic or texture instruction.
HI Joachim. I was wondering if you've made any progress on this? I'm having the exact same issue-- OpenGL and GLES 2.0 both just show up solid black, in the preview and in the scene, no matter the complexity of the shader. This was in a brand new project as well as one set up for iOS platform (though not on target hardware, yet). Am going to test that tomorrow after I get an iPad).
Having the same problem. 
Is this for all shaders, or does it only happen with specific settings?
For instance - if you insert a red color into Emission, and set the shader to Unlit, does it work?
If you input red into Diffuse, and set it to blinn-phong, and set it to only receive a single directional light, does it work?

Also, any errors or warnings in the console/logs?
Hi Joachim. First I would like to say that I love what you have done with shader forge. Now I am having this same problem where the shader comes out black, I am using unity version 4.5.0
I am using shader forge 0.32
I am receiving a serialization depth error in the console
The shader looks black on all settings Direct3D 9, Direct3D 11, opengl, and opengl es 2.0
and I have tried all 4 lighting modes

https://www.dropbox.com/s/0wwar95os1gsq7w/Screensh...
Hey Trent!
If you're getting that error, you just need to update to the latest version of SF, and it should work out :)
Thank you for responding so quickly, When I upgraded to the current version of shaderforge I got this error
https://www.dropbox.com/s/1zqig2r7njli6ha/Screenshot%202014-09-08%2013.06.27.png?dl=0
Thank you very much Joachim, that fixed it after I made a new shader, 
https://www.dropbox.com/s/6olqe59tez7ur5k/Screensh...
However on the old shader it seems the properties aren't appearing which may have been the reason it was black 
https://www.dropbox.com/s/1d9t8cu9jeyx3cr/Screensh...

You might have to delete and recreate those nodes and/or shaders, since they were created in such an old version
I attempted that and the issue persisted, I will just recreate that shader since the issue is fixed on newly created shaders.
I just thought I would bring this to your attention in case a similar issue happens in the future.
Answer
Fixed
This seems to have been due to older versions of SF, closing this thread