Sign up ×
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It's 100% free, no registration required.

I have a really nice looking crystal material using cycles applied to my object; it's pretty fast and very simple - Just one glass node. Is there any way to convert this into an HLSL shader for use wihthin Unity? My understanding is that cycles materials are left out when Blender files are used in Unity.

share|improve this question
Related: – gandalf3 Nov 25 '14 at 10:06

2 Answers 2

up vote 8 down vote accepted

I don't think that is possible, at least the results will look different. Cycles uses a completely different rendering system than what realtime graphics applications like Unity use.

The Cycles Renderer is a ray tracer and has full knowledge of the whole scene all the time. It can model shadows, reflections, refractions and indirect lighting pretty easily, but they cost a lot of computation power.

Unity on the other hand uses OpenGL and Direct3D for rendering. Both APIs are optimized for realtime graphics, but during rendering only single objects are known. Reflections and shadows have to be faked by rendering the scene multiple times from different angles. To get performant global illumination it is precalculated and refractions are usually faked by distorting the final image.
So even if you export all the settings from Cycles to Unity, the rendering engine in Unity can not use them correctly.

share|improve this answer
Okay, thanks for the info. – einsteinsci May 7 '14 at 22:30
im sad now... I thought unity handled things such as this ALOT better... – John Jun 2 '14 at 21:43
Well, a pathtracer such as cycles is just a completely different rendering system than a rasterizer. This is not a problem of Unity. If you want real-time performance for your game you just have to fake a lot of the image calculation. – maddin45 Jun 2 '14 at 21:56
@John Unity handles things fine in terms of how it does its rendering. Unity uses a rasterisation engine, which simply uses camera data to figure out where each object appears on the camera and then colours the pixels in accordingly. Cycles is different, it shoots virtual light rays out into the world until they hit something. It then calculates where the ray bounces to next, figuring out the colour of things as it goes. Those bounces are what makes Cycles too slow for high quality real-time rendering, but it's also why things like glass and gloss look so detailed. – Pharap Dec 23 '14 at 5:52

You could approach this in a way that I have found relatively decent although it doesn't necessarily achieve the complete result of a cycles material. What you could do is:

  1. Bake your material to your model without lighting or just have the scene 100 percent lit. There is a good explanation of this on this page of the forum:

    How do I bake a texture using Cycles bake

What this will accomplish is a model with a diffuse material, but a baked "texture" (UV mapped) version of your material.

If you have a complex or semi translucent material then this becomes a bit problematic. As others have mentioned, the raytracing render method that blender uses is far different from the realtime materials used in unity. You have to fake things like reflections and translucency when you bake textures in blender and then transfer them to unity.

But if you want a basic texture based off your material, you can accomplish that with the method above.

  1. Then you would export the fbx model along with your baked texture from blender and apply a unity supported realtime shader in unity.
share|improve this answer
Could you please summarize your answer? It is currently so wordy that it is hard to follow what you are saying. Use bullet-points to mark the different steps, and if possible add illustrations. – NᴏᴠɪᴄᴇIɴDɪsɢᴜɪsᴇ Dec 23 '14 at 17:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.