Garux / netradiant-custom

The open-source, cross-platform level editor for id Tech based games.
https://garux.github.io/NRC/
Other
301 stars 53 forks source link

giant white squares rendering on models near camera. #24

Closed eGax closed 4 years ago

eGax commented 5 years ago

Using the release build of netradiant-custom-ubuntu-18-04-x8664. (BTW what is ubuntu specific about this build??)_ netradiant-custom-20181213 on Manjaro Linux KDE with Nvidia proprietary driver.

When looking at q3dm17sample.map these giant white squares appear over parts of the grid view and in 3d view as you move close to a displayed model in view making it a bad experience. The corner of the squares seems to start from the model's origin. Here is a small video I made demonstrating the issue.

Watch the video

Let me know if there is any further info you need. I will reply when I can.

Garux commented 5 years ago

Video exposes the problem explicitly, you got no font initialized for openGL rendering, i e no textures names, axes names; squares are entity names.
Build was built @ ubuntu.

Pollito001 commented 5 years ago

@eGax I have the same problem, Im using Manjaro with nvidia non-free driver. Any solution?

Garux commented 5 years ago

It's not a driver issue, but pango/freetype font initialization issue
I can prevent rendering in this case, but missing textual data in viewports ain't good either
@Pollito001 can we get in touch in discord (i'm niger#7855 there) to figure out better solution?

Garux commented 5 years ago

https://github.com/Garux/netradiant-custom/commit/11724e3d58b6464ae4475cba194e37a0a777b0cf

Pollito001 commented 5 years ago

@Garux I try your fix and the white square gone, Thanks ;)

Pollito001 commented 5 years ago

Another question, Is posible to add half life support?

Garux commented 5 years ago

I still suggest to figure out real fix, this data must be rendered: HL is supported already except of models and sprites

Pollito001 commented 5 years ago

@Garux Is estrange because before i format my laptop and replace Manjaro 18.0.3 with 18.0.4 that works normally.

Garux commented 5 years ago

try menu->misc->colors->opengl font

Pollito001 commented 5 years ago

@Garux it works i change the font in menu->misc->colors->opengl font, for deyavu sans mono and works prefect now. Thanks.

Pollito001 commented 5 years ago

netradiant-custom

Garux commented 5 years ago

So definite fix for this would be hardcoding default font name to one, which would work at any linux.
Code fallbacks to the g_object_get( settings, "gtk-font-name", &fontname, NULL );, but this haven't worked in topic distro, as far, as i can see.

eGax commented 5 years ago

Yeah, I just assumed because gtkradiant & netradiant work on my system without issue netradiant-custom would too. I haven't had time to build since 11724e3, but judging from @Pollito001 's feedback looks like it fixes the issue. I will try to build it soon and check it out for myself. Thanks.

Garux commented 5 years ago

Must work out of the box now: https://github.com/Garux/netradiant-custom/commit/eff4d4224c11d4db435c869cdda8b84686221891

eGax commented 5 years ago

Well the white squares are gone, but still no font displayed inside the view windows and now with lots of error messages on startup with my build of commit https://github.com/Garux/netradiant-custom/commit/f45f759b438f091739959db41450bd8cb38ef999. In the terminal I see: (radiant:19071): GdkGLExt-WARNING **: 05:39:12.902: cannot load PangoFont

Followed by a large popup window many errors on every startup or when changing the opengl font via the Misc menu.

In the editor console after all the normal GL_ lines I see the same errors from the popup:

libs/gtkutil/glfont.cpp:745
assertion failure: font for OpenGL rendering was not created

./radiant(+0x1838e1) [0x55ca99b088e1]
./radiant(+0xdf785) [0x55ca99a64785]
./radiant(+0x1bbd2b) [0x55ca99b40d2b]
./radiant(+0xcf311) [0x55ca99a54311]
./radiant(+0x1bc7e9) [0x55ca99b417e9]
/usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x1b5) [0x7fc612529e75]
/usr/lib/libgobject-2.0.so.0(+0x1ffd5) [0x7fc612516fd5]
/usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0xebe) [0x7fc61251b1ae]
/usr/lib/libgobject-2.0.so.0(g_signal_emit+0x90) [0x7fc61251c080]
/usr/lib/libgtk-x11-2.0.so.0(gtk_widget_realize+0xd2) [0x7fc612d9d582]
./radiant(+0x1bc5cf) [0x55ca99b415cf]
/usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x1b5) [0x7fc612529e75]
/usr/lib/libgobject-2.0.so.0(+0x1ffd5) [0x7fc612516fd5]
/usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0xebe) [0x7fc61251b1ae]
/usr/lib/libgobject-2.0.so.0(g_signal_emit+0x90) [0x7fc61251c080]
/usr/lib/libgtk-x11-2.0.so.0(+0x248a79) [0x7fc612d96a79]
/usr/lib/libgtk-x11-2.0.so.0(+0xlibs/gtkutil/glfont.cpp:745
assertion failure: font for OpenGL rendering was not created
Garux commented 5 years ago

This is strange, because it worked for @Pollito001 Rendering non GdkGLExt part of texts is likely possible @%yourdistro%, since regular NetRadiant does this (slowly). I'm out of ideas, except of experimenting at the problematic platform.

eGax commented 5 years ago

That's fine, I will stick to NetRadiant when I need it as an option over or in addition to TrenchBroom.

Thanks for trying.

neogeographica commented 5 years ago

(edited this a bit after re-reading the thread)

I'm on a variant of Ubuntu 18.04 here (elementary OS 5).

Until commit eff4d4224c11d4db435c869cdda8b84686221891 that added the assertion, the OpenGL Font selection process was broken (in my case) insofar as the selected font didn't appear to be used, but removing the hardcoded fallback font names has made things extra-unhappy.

It looks like before those fallbacks were removed, "fixed 8" was working on my system.

If I update to a later commit that has the problem, but I manually edit my ~/.netradiant/1.5.0/q3.game/local.pref file to set the OpenGLFont value to "Fixed 8", then things work OK and text is rendered.

I should note that "Fixed 8" is not a choice in the OpenGL Font menu. And none of the (valid, installed) fonts that ARE in the menu will work if selected.

Garux commented 5 years ago

So the common problem is gdk_gl_font_use_pango_font() functioning/not, depending on some of yourdistro/font/pango lib options.
This is likely why gtk and net radiants switched to different (very slow) text rendering method.
Here i use two methods: gdk_gl_font_use_pango_font() for bitmap display lists font and text labels, rendered to texture. Font initialisation stops, if the first part fails.
Hardcoded font names was old workaround for gtk, returning bad font name on Windows specifically.
I think a good fix would be adding own code to generate display lists font.

offtopic: @neogeographica , i recall your MeshTex plugin and got stuck at finding smart patch unwrapping algorithm for the new uv manipulator. Perhaps you might have some good notion of one. I'll create respective issue, if you are interested.

Garux commented 5 years ago

Added trial and error code, like other s/w, experiencing this problem.
Only working hardcoded font in Ubuntu 18.04 is clean; Only two working ones from OpenGL font selector are Bitstream Charter and Courier 10 Pitch;
At the same time rendered to texture text labels code works with any font.
gtkglext code is failing somewhere at pango_x_font_map_for_display() or pango_font_map_load_font() functions, radiant code works with pango_ft2_font_map_new() and pango_ft2_render_layout_subpixel().

neogeographica commented 4 years ago

@Garux, about that UV editor issue... I've thought about it and I don't think I can carve out time right now to get up to speed on that and make any real progress. Sorry! If you have any very specific questions we should talk/think about together, we can track that on an issue if you think that would be helpful, but generally that's dealing with some very dusty brain cells for me.

Garux commented 4 years ago

@neogeographica, alright, UV Tool is already here, so there is only topic of better unwrapping left; created the issue: https://github.com/Garux/netradiant-custom/issues/27

eGax commented 4 years ago

@Garux I revisited this and just built from https://github.com/Garux/netradiant-custom/commit/6a5d1482849d358d70fbeb886402edafd59e92e3 and any previous issue I had is gone and all seems working fine. Closing this! Thank you for your work on this project.