OpenGL 3D Game Tutorial 32: Font Rendering

preview_player
Показать описание
LWJGL tutorial series on how to create a 3D Java game with OpenGL!

Rendering text this week!

Hiero Download ( scroll down on the page for Hiero. It has been updated since this video was made, so you also need to set the "Rendering" option to "Java" when you're using it. Everything else should be the same):

Sample Fonts:

Font Code Packages Download:

Full code download (attempt the tutorial first though!):

Upcoming tutorials:

- Signed Distance Field Fonts
- Particle Effects
- Random Terrain Generation
- Shadows

Future Tutorial Series:

- Game Audio
- Multiplayer
- Advanced Game Dev Concepts
- OpenGL Optimizing Techniques

Previous tutorial topics:

- Display
- VAOs and VBOs - Rendering a quad
- Rendering using glDrawElements
- Shader introduction
- Coloring using shaders
- Texturing
- Matrices, moving and rotating
- Loading 3D OBJ models
- Lighting I
- Lighting II
- Optimizations
- Transparency
- Fog
- Multitexturing
- Player Movement
- 3rd Person Camera
- Mipmapping
- Terrain Generation
- Terrain Collision Detection
- Texture Atlases
- GUIs/HUDs
- Multiple Light sources
- Point light attenuation
- Skybox
- Day/Night
- 3D Mouse Picking
- Water
- Cel Shading
- Normal Mapping
- Rendering Text

End of video music- Kai Engel, "Waking Stars":

Рекомендации по теме
Комментарии
Автор

If you have problems with an error in the MetaFile (when trying to read the file). The new Hiero versions adds "kernings"-information to the bottom of the file, which ThinMatrix wasn't considering. Just change line 80 in MetaFile.java to the following (method processNextLine):

if (line == null || line.startsWith("kerning")) {
return false;
}

Previously it's without the kerning part.

Kahitar
Автор

Again congrats for this series of tutorial videos! :) You've done an excellent job as I'm sure it took a tremendous work creating them involving of course lots of time and energy! It's always nice to see someone passionate and dedicated in his work and being so careful to make a perfect work! :) These tutorials are really helpful for us all who are learning programming! :P Also a big help for us are all of the downloadable materials (images, code) which would have taken us a lot of time writing them down(the code)/searching them(the images)!... So thank you very much for them and for the answers at our questions and keep up the good quality work! :)

SammySylvester
Автор

It works!, I had to watch on 0.5 speed and pause

DavidDolynny
Автор

That was a dog? I always thought it was a cow. The nostalgia from watching your older videos ;)

butterhead
Автор

you don't know how I have been waiting for this :D

mindjinx
Автор

Best explanation on the subject! Better than all the other tutorials I've read! Great job!

vexedev
Автор

Hey ThinMatrix! It's very sad that the kickstarter campain didn't succeed :C

close to the end of the video you are talking about the translation of the coordinates of the text to the OpenGL Space by multiplying the coords by 2. I wondered about what happens to the negative opengl coords from 0 to -1 ? I worked on a shader-based 2D particle system and couldn't get the damn orthographic matrix working. so I found this interessting. I fixed that for me with: x*2-1 ! maybe I missed something in the video but that works for me :D

thank you for making this tutorial videos you help some people a lot!
greetings,
Florian

necrostyleLP
Автор

Does this method for drawing text work well with live text rendering? Because I imagine that I would, at some point in my game, want to include a counter of sorts or a score label, both of which would need to draw new text pretty much every frame.

gliese-b
Автор

Hey, ThinMatrix! Loving the tutorials. Can you by chance do a tutorial at some point on your collision method for objects(not the heightmap collision)? I'm having some trouble wrapping my mind around the sweep-and-prune method.

Thanks so much!

RyanFleury
Автор

I had a problem where my text was all messed up. Turns out the problem was in the Texture class. With the STBImage package there is a method which flips all textures. So I had to either flip the fontTextureAtlas or add a check in the code to fix it!

tukker
Автор

How would you render text that is constantly updating? For example, text shows the player's y coordinate

crimsondespair_
Автор

How do i transfer from guitext cords system to opengl system.

fishingbadboys
Автор

Nice video! What I used to do before was use the ascii code to find the chars in a bitmap assci arranged characters, call whatever character I need to get texCoords and then render on a Quad. But This method looks really efficient. Thanks!

sauravsikarwar
Автор

By the way does editing the text require you to remove the text and add another GUIText object? Because I have a feeling that a more efficient way of editing the text could be implemented.

aber
Автор

How can I make this font update? Because I'm trying to make a text box in which i can edit it.

da_kgamer
Автор

This is brilliant, thank you! Cheers!

kennyroody
Автор

Awesome tutorial ! Will check it out later today :)

fredvin
Автор

Can you do a tutorial about shadow mapping or a particle engine?

TheNeon
Автор

ThinMatrix,
My text just does not appear on the screen could you help

siddharthasingh
Автор

Wow, Tanks!! It worked! though I got another question: How to implement ASCII \n (enter) and ASCII \t (tab)? I've tried to do it in the same way as we did with the space character but It just doesn't wanna work. Any Suggestions?

samuelkeresztes