<p>If silhouette is not important, you could bend the shading normal near edges. </p>

<p>Since it's a cube you can probably compute the normal procedurally in the shader based off of the uv. I.e. if uv is in range [0,0.1] or [0.9,1.0] start bending the normal towards horizontal. </p>

<p>If silhouette is important, drawing a rounded cube model with vertex normals would make the most sense. There are cube models which have the beveling to look like a rounded cube.</p>

CC BY-SA 4.0
2019-08-03T20:59:01.793Z
2019-08-03T20:59:01.793Z
Calvin
<p>If I have a cube in OpenGL, how can I have it appear like rounded?
 I think it's too complicated to really have the cube rounded so is there any "light trick" to have something like this:</p>

<p><a href="https://i.sstatic.net/wtuxO.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/wtuxO.png" alt="enter image description here"></a></p>

<p>The cubes in the image seem to be rounded on the top. The screenshot is from the game <a href="https://voxatron.com" rel="nofollow noreferrer">Voxatron</a></p>

<p>Another view of the cubes (see how they seem rounded on the top):</p>

<p><a href="https://i.sstatic.net/yQb4V.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/yQb4V.png" alt="enter image description here"></a></p>

CC BY-SA 4.0
2019-08-03T19:52:27.417Z
"*The cubes in the image*" Um, what cubes? I just see some seemingly arbitrary colors.
Nicol Bolas
CC BY-SA 4.0
2019-08-04T03:05:42.683Z
Those look like colors baked into the textures.
Nicol Bolas
<opengl><lighting><mesh>
Pseudo rounded cube in OpenGL
Voko
# Pseudo rounded cube in OpenGL

(Asked by: username_0 on 2019-08-03)

If I have a cube in OpenGL, how can I have it appear like rounded?
I think it's too complicated to really have the cube rounded so is there any "light trick" to have something like this:

[![enter image description here](https://i.sstatic.net/wtuxO.png)](https://i.sstatic.net/wtuxO.png)

The cubes in the image seem to be rounded on the top. The screenshot is from the game [Voxatron](https://voxatron.com)

Another view of the cubes (see how they seem rounded on the top):

[![enter image description here](https://i.sstatic.net/yQb4V.png)](https://i.sstatic.net/yQb4V.png)

**Tags:** opengl, lighting, mesh

> **Comments:**
> **username_1**: "*The cubes in the image*" Um, what cubes? I just see some seemingly arbitrary colors.  
> **username_1**: Those look like colors baked into the textures.  

---

## 1 answers

### Answer by username_2 on 2019-08-03. Score: 3

If silhouette is not important, you could bend the shading normal near edges.

Since it's a cube you can probably compute the normal procedurally in the shader based off of the uv. I.e. if uv is in range [0,0.1] or [0.9,1.0] start bending the normal towards horizontal.

If silhouette is important, drawing a rounded cube model with vertex normals would make the most sense. There are cube models which have the beveling to look like a rounded cube.


---

