How to use 3D Object in 2D game with 2D Pipeline

Is there a way to bring 3D objects into a 2D project that is using the 2D Universal pipeline for rendering? I have some 3D objects I want to bring in to the project I’m working on, but they just get imported as pure white.


Is there a way to import 3D models into a 3D game, and keep the 2D pipeline for lighting? I’l tried a few different shaders, but if they’re not pure white they’re pink. I would like them to have shading as a 3D object, and still interact with light and rotate on all axis if possible. If it’s impossible to use a 3D object, if there was a way to at least have a 2D sprite taken from a 3D object, but still react to light in a 3D way, that’d work too I suppose.

Thanks in advance.

1 Like

You just need to pick an appropriate shader for your materials. Currently you are using “Sprite-Lit” which obviously is not going to work on a non-sprite object. Try “Universal Render Pipeline/SimpleLit” or “Universal Render Pipeline/Lit”. Those are the basic lit ones. All of the standard shaders are going to show up pink in URP.

1 Like

I have tried this, the sphere is still white with no shading. Like I said, I’ve tried multiple different materials. Here’s what it looks like on simple lit


It doesn’t receive light no matter what. I cranked the lighting down to 0, here’s what it looks like, on a Lit material

Do you have any lights in the scene?

Yes, there’s a global light, the second picture is after I turned the global light’s intensity to 0

Global light is only for 2d sprites. Try adding a 3d light such as directional light or point light.

Okay, I added a directional light and a point light, still no luck.

Bump

Can somebody help please?

I am encountering the same problem. I have created a new 2D project, I am using the 2D Renderer Data with UniversalRenderPipeline, but my 3D cube is white.

I wasn’t able to completely solve this, I can’t get shading in. But I was able to change the colour by changing the shader of the object.

Hello,
Did you solved the problem? I’m interested on it!
Thanks a lot!

No sorry, ↑ see previous reply :stuck_out_tongue:

I made a new shader which was just a basic shader. No shading, but I was able to change colour.

Hey, I might be a little late but i found this recently. How do you make lights affect 2D sprites in a 3D environment using Unity's URP render pipeline? . Maybe give this a try?

Just add a Directional Light to the scene

Yes, I’ve tried this and it doesn’t work. See previous comment lol

I just saw this, I tried some of the things in there, unfortunately my issue is kinda the opposite lol. They want a 2D sprite affected by 3D lights, I wanted a 3D mesh affected by light in a 2D renderer.

I still haven’t been able to solve this, I made a basic shader for a voronoi texture so it at least doesn’t look completely white, but it still doesn’t receive shadows.
This is what it looks like with a URP lit shader, directional light in scene.
6842441--796394--upload_2021-2-16_17-22-0.jpg

Ay, my client put this game on hold for a few months so I’m still not in a rush to fix this, but maybe one day I’ll get it fixed XD

Hi, this is something I am curious about too! Would it perhaps be possible to light a 3D object as if it were 2D? E.g render the 3d objects as a sprite per say, so that it lights up as if it were a flat image. I hope that the solution isn’t to convert the lighting system to 3D. Because 3D lighting takes up lots of processing.

It’s not free, but there’s a plugin that converts 3D models to sprites. This might be what you’re looking for?
https://assetstore.unity.com/packages/tools/sprite-management/animation-baking-studio-3d-to-2d-31247
I could swear there was a free one somewhere, but I can’t find it, maybe it’s gone.

I think this may help. You can use URP instead of Light Weight Render Pipeline as mentioned in the post.
http://answers.unity.com/answers/1779020/view.html

I can confirm that the solution posted by gzckrg1 works (2 cameras, one is overlay, etc.)