Page 1 of 1

Shader editor image

Posted: Sun Mar 24, 2013 7:19 pm
by UglyFoot
Hello, I have a simple question. I want to create a shader to have multiple textures of a single color without having to create them using a program. This is a simple shader for a red texture, the idea is to use it to create other colors by changing the value of rgbConst. The problem is I can't see the color in the editor without using an image of that color, can I solve this?

Code: Select all

textures/colors/red
{
	{
		map $lightmap 
		rgbGen const ( 1 0 0 )
	}
}

Re: Shader editor image

Posted: Sun Mar 24, 2013 9:28 pm
by Eraser

Code: Select all

textures/colors/red
{
        qer_editorimage textures/colors/red.tga
	{
		map $lightmap 
		rgbGen const ( 1 0 0 )
	}
}
The referenced editorimage (which is an actual existing tga or jpg file) is only displayed in radiant and does not need to be distributed with the level. Downside is that you'll have to make an editorimage for each color you wish to use if you want the color to show up in the editor.

Oh I think that if you have a tga or jpg image with the same path/filename as the shader on your harddrive (so in your example textures/colors/red.tga), you don't need to specify the editorimage in your shader. Radiant will check for an image to use in the shader's location by default.

Re: Shader editor image

Posted: Mon Mar 25, 2013 1:50 am
by obsidian
As Eraser said, you'll have to have a separate editor image for each shader. You don't need to distribute editor images, they can just be for your own use.

Eraser's second paragraph doesn't make much sense though, seeing as you don't have an actual texture to reference in your shader, only just a lightmap. Derp!

Re: Shader editor image

Posted: Mon Mar 25, 2013 8:23 am
by Eraser
No, his shader is defined as:

textures/colors/red

which means that if he has a file:

(baseq3)/textures/colors/red.tga

then he doesn't need to explicitly define the qer_editorimage parameter inside the shader because Radiant will simply look for textures/colors/red.tga (or .jpg) by default if no qer_editorimage was defined.

Re: Shader editor image

Posted: Mon Mar 25, 2013 2:34 pm
by obsidian
Eraser: Oh, I see what you mean. I thought you were still referring to your modified shader with qer_editorImage, or if there were a texture stage.


UglyFoot to be clear, your original shader is fine, but you still need a dummy file in "textures/colors/red" since the editor has to display something in lieu of the lightmap. You do not have to pack up this texture in your pk3 since it is only used for the editor.

Re: Shader editor image

Posted: Mon Mar 25, 2013 3:15 pm
by UglyFoot
Ok, I will have to open an image editor anyway, so I discard the shader option. Anyway thanks for the replies.