How much freedom do I get in unity?

I am learning graphics programming and I am currently creating my own little engine. Poorly an engine is more than just graphics and I am literally only interested in the graphics part.

How much freedom do I get in unity?
Can I create my own lighting solution?
Where are the limitations?

At the moment I mirrored many algorithms of the cryengine in my own little graphics engine and it would be great if I could port them to unity. I just don’t know how much low level access I will get.

Edit:

I accidentally posted in the wrong section and it seems that here is no delete button :confused: Please delete this one, thanks

thats a good question. You do NOT get source code access, but you can create your own shaders. You can also create meshes by hand (supply the verts, uvs, normals) With unity4, you have directx 11 access, but I honestly dont know what that means. So I dont know if that is nothing more than unity using directx 11 now, or if you can make better shaders. I dont think you can do directx api calls in your scripts.

Oh yeah, since unity pro allows you to use dlls, you may be able compile some of your algorithms there, and import them in unity…just not sure how you would do any rendering that way.

As for lighting and other cool effects, I’m not sure. I dont know too much about advanced graphic techniques, so I dont know what you need to do as a shader, or do in source code and what can be faked in scripting. I know people here have claimed to be able to replicate many things like the cry engine terrain in script, but I never verified them for myself, or did a side by side comparison.

Im curious for the answer to your question too, so I hope somebody else can chime in and give more info

You can create your own shaders. You can create/modify your own meshes. You also have low-level access to immediate mode drawing, if you just want to do it all yourself:

this type of questiond ever are incomplete, Unity free an pro are very diferent things, but both not have source access.

@511, as others have said, you don’t get source code access, but you can write shaders utilizing DX11 features, like tessellation. You also get low-level GL access.

They are not very different at all. They have some differences, but a humongous portion Unity’s total features is shared between the two. Unity Pro has more low-level access than Unity Free, a profiler, and quite a few other nice features, but nothing that would be necessary for the core gameplay of any game (you know, the important part). Also, the questions may be open-ended, but they are not incomplete.

Yes I just saw that unity supports direct3d 11 but no opengl 4.x (only OpenGL 2.x). This is very unsatisfying for me, because this implies that I can use it only on windows, but I also want to develop on linux and I don’t want to use the fixed function pipeline.

Also what bugs me is that unity is using physX which will only run on nvidia graphic cards. Or on the cpu if you have an AMD card. But this is a little bit too offtopic.
But I probably just continue with my own little engine.

No, it doesn’t imply that. Unity is used for OS X and Linux. Direct3D 11 is a new feature in Unity 4 so currently no games actually use it yet, and it’s fairly specialized. You’re not limited to a fixed function pipeline in OpenGL.

It does not run on nVidia graphics cards in Unity. It runs the same on all GPUs (namely, it doesn’t run on GPUs at all, it’s purely CPU-driven).

–Eric

You might get better answers if you posted part of your question in the shaders forum.

Unity is pretty open in terms of shader development, though it can be a bit of an uphill struggle to get to grips with the way it works (shaderLab, surface shaders).

I think the biggest issue is that you don’t have control over some parts of the data chain, i.e. what is passed to the shaders. E.g. scene light information, passing arbitrary data arrays etc (excluding dx11 compute shaders). At least as far as I can tell.

For example, Unity seems to work with a one draw call per light (some exceptions with point lights, i.e. closest 4 point lights), in both forward and deferred. It also uses texture maps to create spot and point lights, meaning as far as I can tell the engine does not provide some information about lights directly to a shader (e.g. spot angle, direction etc).

So whilst you have great control over the lighting equations used (pretty much can write you own), you have minimal information about the ‘most relevant’ lights within a shader, making some things harder.

The best thing is to try Unity out, you should be able to get quite far with just Unity free and you can get a pro trial for 30 days. That should give you enough information as to whether you have enough access to low level features that you need.

edit: Oh yeah forgot to mention that Unity Pro now provides access to the 3d context to plugins (excluding mobile), so that might be an alternate method of getting around any restrictions/issues mentioned above. see low-level Native Plugin Interface.