Shader editor image

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
UglyFoot
Posts: 139
Joined: Fri Jul 22, 2011 12:35 pm

Shader editor image

Post 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 )
	}
}
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: Shader editor image

Post 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.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Shader editor image

Post 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!
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: Shader editor image

Post 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.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Shader editor image

Post 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.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
UglyFoot
Posts: 139
Joined: Fri Jul 22, 2011 12:35 pm

Re: Shader editor image

Post by UglyFoot »

Ok, I will have to open an image editor anyway, so I discard the shader option. Anyway thanks for the replies.
Post Reply