lfnetwork.com mark read register faq members calendar

Thread: Loading shaders in GTK
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 09-10-2005, 04:44 PM   #1
JeeMonkey
Rookie
 
JeeMonkey's Avatar
 
Join Date: Jan 2004
Location: around
Posts: 138
Loading shaders in GTK

A question about shaders in general.
Right now I am able to create a shader such that, after I compile my map I can see the shader as it is supposed to be seen. But when I open GTK and load the shader, all I get is a black and red checkered texture that is very very small. Had I made the shader correctly, or imported it correctly, it would load as a white box saying "sky" on it... or it would load as a 2D image of that shader (such as when you load the shader file for water shader that moves like waves).

When a shader file loads as the black and red checkered texture, what did I do wrong and how do I fix it?
JeeMonkey is offline   you may: quote & reply,
Old 09-10-2005, 07:08 PM   #2
lassev
cryptoscripter
 
lassev's Avatar
 
Join Date: Jun 2002
Location: Finland
Posts: 1,087
The basic principle of shaders is the preference of replacement. By that I mean they will replace a basic texture of the same name. This works as well for the textures of models or effects. This means that if your shader entry is named exactly the same as a physical texture in the textures folder, the shader will replace the basic texture, and the basic texture won't exist anymore, in a sense.

If the shader entry is a novel name, then it will be effectively a new texture, and it requires an editorimage attribute in the shader code for it to properly be shown in Radiant, as a physical texture by that name doesn't exist. However, the editorimage won't be necessary for the game itself. Furthermore, nothing prevents from giving a physical texture name entry (replacement shader) a "conflicting" editorimage, although it's not necessary, but sometimes convenient.

If you fail to provide an editorimage for a novel shader entry name, or enter a nonexisting editorimage, Radiant won't be able to locate any image for the shader to be displayed in the editor. This will result in that shader not found error texture. For example some Raven editorimages are missing, I think.


Frozen by ICARUS
lassev is offline   you may: quote & reply,
Old 09-14-2005, 07:39 PM   #3
wedge2211
Commander, Rogue Squadron
 
wedge2211's Avatar
 
Join Date: Jul 2002
Location: Ithaca, NY
Posts: 2,320
Code:
textures/atlantis/ocean ***
{
	qer_editorimage	textures/atlantis/ocean
	surfaceparm	nomarks
	surfaceparm	nonsolid
	surfaceparm	nonopaque
	surfaceparm	water
	surfaceparm	trans
	q3map_material	Water
	q3map_onlyvertexlighting
	deformvertexes	wave	100 sin 1 2 2 0.6
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
    {
        map textures/atlantis/ocean ***
        blendFunc GL_DST_COLOR GL_ZERO
        tcMod turb 0.01 0.03 5 0.1
        tcMod stretch noise 1 0.01 1 1
    }
    {
        map textures/atlantis/ocean ***
        blendFunc GL_ONE GL_ONE
        tcMod turb 0.02 -0.06 0 0.1
        tcMod stretch noise 4 1 0 0.01
    }
}
*** - This change makes the shader appear properly as "ocean" under the "atlantis" texture set. What you had before just replaces "water_1" in the "common" texture set, and might have caused problems.
*** - This change makes the water look like your image atlantis/ocean instead of the previous common/water_1.



Last edited by wedge2211; 09-14-2005 at 07:44 PM. Reason: made it preserve proper tabs and added a bit of explanation
wedge2211 is offline   you may: quote & reply,
Old 09-15-2005, 12:02 PM   #4
JeeMonkey
Rookie
 
JeeMonkey's Avatar
 
Join Date: Jan 2004
Location: around
Posts: 138
SHOOT! I'm sorry, my last post was inccorect, so I deleted it. This is what I meant to say:

Quote:
Originally Posted by JeeMonkey
Ok I changed what I think you asked me to, and it didn't work. plus, now the red and black checkered square wont load anymore.


Here is what I started with...
Code:
textures/atlantis/ocean
{
	qer_editorimage	textures/common/water_1
	surfaceparm	nomarks
	surfaceparm	nonsolid
	surfaceparm	nonopaque
	surfaceparm	water
	surfaceparm	trans
	q3map_material	Water
	q3map_onlyvertexlighting
	deformvertexes	wave	100 sin 1 2 2 0.6
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
    {
        map textures/common/water_1
        blendFunc GL_DST_COLOR GL_ZERO
        tcMod turb 0.01 0.03 5 0.1
        tcMod stretch noise 1 0.01 1 1
    }
    {
        map textures/common/water_1
        blendFunc GL_ONE GL_ONE
        tcMod turb 0.02 -0.06 0 0.1
        tcMod stretch noise 4 1 0 0.01
    }
}
Here is what I thought you asked me to change...

Code:
textures/atlantis/ocean
{
	qer_editorimage	textures/atlantis/ocean
	surfaceparm	nomarks
	surfaceparm	nonsolid
	surfaceparm	nonopaque
	surfaceparm	water
	surfaceparm	trans
	q3map_material	Water
	q3map_onlyvertexlighting
	deformvertexes	wave	100 sin 1 2 2 0.6
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
    {
        map textures/common/water_1
        blendFunc GL_DST_COLOR GL_ZERO
        tcMod turb 0.01 0.03 5 0.1
        tcMod stretch noise 1 0.01 1 1
    }
    {
        map textures/common/water_1
        blendFunc GL_ONE GL_ONE
        tcMod turb 0.02 -0.06 0 0.1
        tcMod stretch noise 4 1 0 0.01
    }
}
What am I missing, or what did I do wrong?
There is no textures/atlantis/ocean
That is just what I chose to call this shader.
JeeMonkey is offline   you may: quote & reply,
Old 09-15-2005, 04:45 PM   #5
lassev
cryptoscripter
 
lassev's Avatar
 
Join Date: Jun 2002
Location: Finland
Posts: 1,087
If there is no "textures/atlantis/ocean" physical texture, then you obviously cannot enter that as an editorimage. Otherwise the shader you started with looks just fine. If it doesn't work, it's either because you haven't entered your shader file's name in the shaderlist or your Radiant and/or game installation is screwed.

Might be the latter case, because you certainly are having far more problems with basic shaders than anybody I have seen before.


Frozen by ICARUS
lassev is offline   you may: quote & reply,
Old 09-15-2005, 05:31 PM   #6
JeeMonkey
Rookie
 
JeeMonkey's Avatar
 
Join Date: Jan 2004
Location: around
Posts: 138
when i use the shader i started with, and take a copy of textures/common/water_1 and rename it and move it to textures/atlantis/ocean, then when i load gtk the shader appears as water rather than a red and black checkered square. but it seems silly thet that is what I have to do to view an altered shader in radiant.
JeeMonkey is offline   you may: quote & reply,
Old 09-15-2005, 06:17 PM   #7
lassev
cryptoscripter
 
lassev's Avatar
 
Join Date: Jun 2002
Location: Finland
Posts: 1,087
Well, you don't. There's no reason to have duplicate textures. Only when you photoshop an altered version of an old Raven texture, you should need to do that.

When you say you copy the texture with a new name, are you sure you still get a shader in Radiant, and not just the basic texture?


Frozen by ICARUS
lassev is offline   you may: quote & reply,
Old 09-15-2005, 07:22 PM   #8
wedge2211
Commander, Rogue Squadron
 
wedge2211's Avatar
 
Join Date: Jul 2002
Location: Ithaca, NY
Posts: 2,320
When you mention textures/whatever/whatever INSIDE the shader code (inside the outermost set of { }'s), then you are referring to an image file. It must exist on your hard drive or in a pk3 as a jpg, tga, or png file. The heading at the top of the shader file is the name of the SHADER, all other textures/... references are image stages.


wedge2211 is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Mapping > Loading shaders in GTK

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:10 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.