Garux / netradiant-custom

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

Netradiant (Custom) + ioQuake => missing shaders, textures only in editor and not in the game #123

Closed serious-coder20 closed 5 months ago

serious-coder20 commented 1 year ago

Hello, I am just a new enthusiast trying to practice level development (Quake 3). So I installed latest versions of netradiant (Custom) , ioquake.

I tried loading a custom map in the netradiant. However I noticed many models has "Shader not found", "Texture image missing" etc instead of real textures. See the first image of the editor (note the viewport and the red console errors in the image).

However I came to know that this just shows up in the editor and not when I actually play the level inside the game (meaning by loading custom map in the quake 3 console).

In this example, the custom level i opened in the netradiant is named "xcm_tricks2", its zip file has all the textures, scripts etc.

Please refer to both images to understand my point. I want the map to load all the textures in the editor like it does in the game.

I did some extensive research on the web in regards to this issue (like updating shaderlist files , setting proper path for game in editor etc) but couldn't find much resources. My engine path in the net radiant editor is set to "C:/Program Files (x86)/ioquake3/". Would appreciate any help nd advice. Thanks.

01 02

Garux commented 1 year ago

You either use shaderlist, which is whitelist, or have no shaderlist to load everything, like game does. Wrt shader images, maps usually don't include them. Editor doesn't deduce them from shader stages, which is likely good idea, because:

  1. texture alignment in map file depends on editor image size
  2. deduction rules may be obscure for mapper
  3. shader stages tend to be changed during map development
serious-coder20 commented 1 year ago

Hi, thanks for your response.

When i check inside the "C:\Program Files (x86)\ioquake3\baseq3\scripts" folder, i see many shader files and 2 shader txt files namely :

"default_shaderlist.txt" "shaderlist.txt"

The contents of "shaderlist.txt" :

//**// // shaderlist.txt modified for Q3Radiant // // by Eutectic - 13 May 2000 // // // // Rev history: // // 08/11/2000 // TTimo - changed liquid to liquids and sky to skies for better // // consistency with the directories and actual shader names // // // // Added the names of the new shader files created as a result // // of the cleanup of the old shader files so Q3Radiant will read // // and display all the shaders in the texture window. // // // // SHADER FILE NAMES ADDED: // // base_door // // gothic_button // // gothic_door // //**//

// this file lists all the separate shader files base_button base_door base_floor base_light base_object base_support base_trim base_wall common ctf //eerie //gfx //hell gothic_block gothic_button gothic_door gothic_floor gothic_light gothic_trim gothic_wall liquids //menu models organics sfx skin skies

Inside the "xcm_tricks2" zip file (custom quake 3 map I downloaded online), "XCM_Tricks2\scripts" are many shader files (which i already unzipped into the ioquake baseq3 folder before playing the map. (see the image)

a

So as per what u mentioned, ALL the shaders (that came in the custom map zip file "xcm_tricks2" be listed in the "shaderlist.txt" file that is present in the default \ioquake3\baseq3\scripts folder?

Now in order to make all the texture visible, I want to know which names should be added to which list.

Garux commented 1 year ago

image

serious-coder20 commented 1 year ago

Hello, thanks so much for your response.

From what I could understand from your first response is that the default "shaderlist.txt" in the main game baseq3 folder seems to be whitelist meaning "allow list". So if that's removed from the game, means all shaders allowed? Just like turning off windows firewall.

I tried doing that and yes I could see some difference. See images first and second here:

01 02

u can see that when the default "shaderlist.txt" is removed from the main game baseq3 folder the main back green skybox appears in the netradiant editor viewport.

But then I finally updated the "shaderlist.txt" by adding all the names of the shaders that came in the "xcm_tricks2" zip map file : shaderlist.txt

And the green skybox was still present in the netradiant editor viewport but i noticed many game objects still missing shaders/images (only in the netradiant editor) and NOT in the game. See images third and fourth here :

03 04

For instance this large round yellow health powerup says missing shader only in the netradiant editor and not when inside the game is played. Inside the game it appears and functions just normal with no issues.

I did some more search and i noticed that this powerup is the part of "models" in the baseq3 folders. Usually these models ".md3" files also have texture images placed in their respective folders, but for these health powerups, unfortunately no texture files (.tga, jpg, png) etc were present (see fifth image) here :

05

I guess maybe due to this reason the netradiant editor console gives red errors while loading this map and associated healthpack textures (see third image) and left editor console red errors.

I also tried opening this particular large yellow health powerup ".md3" file in Noesis model viewer, but it just opens up plain flat white with no textures applied. (See image sixth) here :

06

I then tried to access the associated model shader file in the scripts folder of main baseq3 game folder. Named "models.shader". After going through its contents :

<see models.shader in the main game folder "\ioquake3\baseq3\scripts"> // not pasting contents here coz it too long

I could notice that the game is instead trying to load these health ball textures from the "ioquake3\baseq3\textures\effects" folder. See this image :

07

The engine then applies transparency and effects to the selected objects this texture is assigned to (as per the functions and attributes defined in the models.shader file for that model). I then thought if i could apply these textures from this above folder I could probably get the health powerup texture to appear in the netradiant viewport, but i am unable to apply this to the health powerup in netradiant editor.

Also note that this particular model is named as "health_large" in the netradiant editor but when i checked in the "\ioquake3\baseq3\models\powerups\health" folder, this item probably is one named "large_sphere.md3" (second one in the list, see fifth image). It looks like the netradiant editor loads up with some game models/objects named diferently than those present in the ioquake baseq3 folder, and because of that the shader image missing, texture missing error?

If i can know the techniques to restore this particular texture to appear in the netradiant editor i can then probably try to restore all other missing shaders/textures images for other maps as well.

Garux commented 1 year ago

These health shaders aren't vital for mapping, it's for entity preview. They are fixed among many other QoL things in q3pack, which you can grab from releases, e.g. this https://github.com/Garux/netradiant-custom/releases/tag/20220211. Has txt on how to drop it.

serious-coder20 commented 1 year ago

Hello, thanks again.

I actually am trying to study the internal working for the editor and engine (how they handle files, resources etc) and learn more by solving issues I face with various versions of both. At many times (specially while working on large dense maps, overpopulated complex maps to identify the right textures for the elements, objects to make sure nothing is out of the flow. If the editor fails to display some texture/shaders then I guess at time it becomes difficult to maintain the overall texture consistency and look.

But i guess ur right to quite extent, it must be due to me downloading the most recent "[Development Build] Pre-release" version (which doesnt include the updated mapacks/resources). I will test on the other full latest version and will comment back soon. Thanks again.

ZecChelovek commented 1 year ago

Similar problem for mapping with Quake 1 + vkQuake. Textures appear in the editor, but not when compiled with Ericwtools: https://imgur.com/a/2ogg3BO The same .map saved in Trenchbroom will have textures when compiled with Ericwtools.

Btw I really like this editor.

EDIT: Fixed with absolute paths.