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.


3 Answers 3


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.

  • $\begingroup$ im sad now... I thought unity handled things such as this ALOT better... $\endgroup$
    – Starius
    Jun 2, 2014 at 21:43
  • 4
    $\begingroup$ 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. $\endgroup$
    – maddin45
    Jun 2, 2014 at 21:56
  • 2
    $\begingroup$ @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. $\endgroup$
    – Pharap
    Dec 23, 2014 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.
  • $\begingroup$ 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. $\endgroup$
    – J Sargent
    Dec 23, 2014 at 17:39

What he is saying is this... What baking does is it turns those settings you have in the node editor, or whatever you are using, and it turns them into a new texture. So all you have to do is apply the texture, and it looks rough, or metallic, or whatever you had. The link he posted was to a forum explaining how to do this.

Now if I remember correctly, it also makes the lighting stick, so the object will have that constant weird glare from wherever your light was pointing when you baked it.

They said to make sure you have either no light, or pure light, so i'm assuming that's why, but i'm not sure.

Take this with a grain of salt, I've only been doing this for about 3 weeks

Also, thank you sooo much, I've been looking everywhere for how to do something like this XD


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .