[Tutorial] How to render shapes [World Renderer - Forge 1.19.4 / 1.20.1]

Started by sumeshi0216 on

Topic category: User side tutorials

Last seen on 11:45, 27. Apr 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[Tutorial] How to render shapes [World Renderer - Forge 1.19.4 / 1.20.1]
Mon, 01/15/2024 - 13:20 (edited)

World Renderer allows you to render shapes like lines, triangles and quads in the sky and world. However, for that you need to learn some things

First, you need to use this procedure and decide what to render

Here is what you can render:

  • DEBUG_LINE_STRIP
  • DEBUG_LINES
  • QUADS
  • TEXTURE
  • TRIANGLE_FAN
  • TRIANGLE_STRIP
  • TRIANGLES

Next, you need to define some vertices, which contain information about position and color. For example, for a triangle, define 3 of them and for a quadrilateral, define 4 of them. Here is number of vertices required

  • DEBUG_LINE: 2
  • DEBUG_LINE_STRIP: 2
  • QUADS: 4
  • TEXTURES: 4
  • TRIANGLE_FAN: 3
  • TRIANGLE_STRIP: 3
  • TRIANGLES: 3

Also, for the world, the position is defined with X/Y/Z coordinates and for the sky, it is defined with yaw/pitch/radius coordinates

An example to render a colorful square:

In addition, shapes have a front and a back, which are defined based on vertex order. Usually, only the front face is visible, the back face is not visible. However, if culling is disabled, both faces will be visible. (See below about culling)

If you define vertices counterclockwise, the face will be a front, and if you define a vertex clockwise, it will be a back


Culling:

When this option is enabled, The back face of shapes is not visible. If you want to display the back face, disable this option


Depth testing:

When this option is enabled, objects will be hided if it is behind obstacles, and when it is disabled, objects will be rendered even if it is

Edited by sumeshi0216 on Mon, 01/15/2024 - 13:20
Last seen on 14:14, 25. Mar 2024
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
am try to make rendering a…
Fri, 02/09/2024 - 16:44

am try to make rendering a texture in world but when i do its either just solid color or completely invisable and idk how make it work help

Last seen on 02:18, 28. Apr 2024
Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do you render the…
Sat, 03/02/2024 - 17:36

How do you render the spheres? Like as seen on the picture on the plugin page.