Rounded cube

Hi guys,

I know how to make a cube and I’ve got a nice shader working on it but for my game I kind of really wanted to smooth the cubes so they are slightly rounded, I’ve tried to Google on how best to do this but I think there’s a big gap between “I have a cube” and “I have a rounded cube” where none of my knowledge fits.

Can anyone help me achieve a rounded cube?

Cube or rectangle? I’m guessing you mean 2D, search rounded rect or round rectangle in the forum search, there are two I’ve seen but they both use lines around a rectangle to create the round effect which isn’t great with any translucency… If you’re looking for 3D I’d ask @Andrew_Stacey he’s great with 3D.

I remember seeing code that does this (3D rounded cube). I’ll see if I can find it later when I have time,

You can make a cube rounded if you use lighting and average the normals across all the corner vertices. If that doesn’t make sense, don’t bother!

Here is is:

That’s awesome, thanks for the link dude!

No problem.