Ritualistic Forums

Go Back   Ritualistic Forums > Ritual Entertainment Games > Star Trek Elite Force II > EF2 Editing Forum

Reply
 
Thread Tools Display Modes
Old 10-05-2003, 03:09 PM   #1
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Excelsior shaders?

Ok - I am confused about a bit of scripting for the Excelsior model. Playing with the model in a test map, it doesn't seem to 'generate' its own lighting - either from its skin or its windows. In other words, it doesnt seem to have a shader established for it. This seems to be confirmed by the fact that there are no 'glow' textures for it - just three standard skin textures:

excelsior_1.tga
excelsior_2.tga
excelsior_3.tga

This is not a problem. In fact, I want to create a new shader for the ship. To do this, I must - amongst other things - create a new tik file. Naturally, I went to look at the old tik file and was surprised by something it contained. For its surface (texture) it listed the three files above as shaders:

TIKI
setup
{
scale 1.0
lod 1 1 1 1 1
path models/vehicle/excelsior
surface material1 shader excelsior_1.tga
surface material2 shader excelsior_2.tga
surface material3 shader excelsior_3.tga
}

This seems strange because I can find no evidence of such shaders - neither as a stand alone shader file in the shaders directory of pak0 nor in the vehicle.shader file in that same directory (vehicle.shader's only mention is for the damage shaders to excelsior - not to the excelsior - or dallas - itself).

This means one of two things:

1. the shader is somewhere else and I can't find it.
2. even though the tik file calls the textures 'shaders' they are in fact NOT shaders but simply standard textures (and it simply calls them shaders because that is the proscribed norm - one references shaders whether or not the texture is actually a shader or not).

Anyone know which is the right answer? I suspect the latter but need confirmation. And if it is the former, then I need help in pinpointing where the shader is located.

Any help would be greatly appreciated.

6of1 is offline   Reply With Quote
Old 10-05-2003, 03:18 PM   #2
7o'nine
Fanboy
 
7o'nine's Avatar
 
Join Date: Mar 2002
Location: Canada
Posts: 555
Default Re: Excelsior shaders?

For all surfaces, after the material ## you will find the word 'shader'.. if the texture ends in ".tga" then it's a normal texture, if the texture has no extension, then the engine looks for a shader [img]/forums/images/graemlins/smile.gif[/img]

Eg:
surface material1 shader excelsior_1.tga
Means a texture only, no shader
surface material1 shader excelsior_1
means a shader

7
7o'nine is offline   Reply With Quote
Old 10-06-2003, 11:40 PM   #3
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: Excelsior shaders?

Ok - I have been able to make adjustments to the excelsior tik so that it will look for my new textures. And these textures do show up properly on the model.

Furthermore, I have successfully tried to make an actual shader for my new excelsior. I say successfully because the texture shows up ur in the right texture dir, and I am able to apply it to brushes with no problem. However, when I try to assign it to the model, it doesn't show up. Instead I get the green and black model texture indicating a missing texture.

I tried changing the extention (none to tga) and I tried switching directories. Both to no avail. Do I need to use a different shader coding for the model than for the brushes (I am using the same coding we used successfully to achieve the lighting on my brush ship).

Any ideas on what I am doing wrong?

(btw - nice to have the board back up again)
6of1 is offline   Reply With Quote
Old 10-07-2003, 02:00 AM   #4
ShadowWatch
Experienced
 
ShadowWatch's Avatar
 
Join Date: Jun 2003
Posts: 119
Default Re: Excelsior shaders?

If you are getting these green squares in Radiant, fear not! Some textures on models just show up that way for some reason. Go ahead and make a test map with just that model in a box with a playerstart to make sure your textures are working, and ignore the fact that they don't show up in Radiant.
ShadowWatch is offline   Reply With Quote
Old 10-07-2003, 02:27 AM   #5
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: Excelsior shaders?

Yes - I am aware that some textures do not come up in ur but still show up properly in ef2. Unfortunately that is not happening in this case. The shader is simply not showing up at all.

Do I somehow need to use different code with the model than I do with brushes? Because otherwise I dont know what is causing the texture to not be applied/found.

6of1 is offline   Reply With Quote
Old 10-07-2003, 08:23 AM   #6
Grudge
Regular
 
Join Date: Jun 2003
Location: Stockholm, Sweden
Posts: 58
Default Re: Excelsior shaders?

Eh. So surfacelight do work in EF2?

I am confused.
Grudge is offline   Reply With Quote
Old 10-07-2003, 12:36 PM   #7
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: Excelsior shaders?

Here is some additional info. First the shader then the tik I am using:

SHADER

models/vehicle/extest/liberty_front
{
qer_editorimage models/vehicle/extest/extest1.tga
if novertexlight
{
map $lightmap
rgbGen identity
}
{
map models/vehicle/extest/extest1.tga
blendFunc FILTER
rgbGen identity
}
{
map models/vehicle/extest/extest1_glow.tga
blendFunc ADD
}
endif
if vertexlight
{
map models/vehicle/extest/extest1.tga
rgbGen default
}
endif
}


TIK

TIKI
setup
{
scale 1.0
lod 1 1 1 1 1

path models/vehicle/extest
surface material1 shader extest_front
surface material2 shader extest2.tga
surface material3 shader extest3.tga
}
init
{
server
{
setsize "0 -170 -10" "416 169 67"
}
client
{
}
}
animations
{
idle extest1.tan
}


/*QUAKED vehicle_extest_extest-front (0.5 0.25 0.25) (0 0 0) (0 0 0)
extest
*/

---

So - any ideas why the shader is not showing up on the model?
6of1 is offline   Reply With Quote
Old 10-07-2003, 01:13 PM   #8
wyeth[ritual]
Casual
 
Join Date: Mar 2001
Location: teh intarnet
Posts: 41
Default Re: Excelsior shaders?

What I'd do is start with the simplist shader and then start adding the properties you want. Like this:

SHADER

models/vehicle/extest/liberty_front
{
{
map models/vehicle/extest/extest1.tga
rgbGen default
}
{
map models/vehicle/extest/extest1_glow.tga
blendFunc ADD
}
}

A few things of note:

1) I removed the if\endif statements to simplify things. With the first pass of your shader as your base texture, in vertex light mode it should by default fall back to that pass and the ship should look ok. You only really have to worry about setting up if\endif vertexlight statements when the first pass (top pass) of your shader is something other than your base texture, or your base texture has a funky blend mode.

2) I removed your lightmap stage. Why? You only want to use a shader which references lightmaps if you are using it on world geometry. Models will not have lightmap information, and the pass will fail when it tries to reference the lightmap information.

3)Instead of choosing a specific RGBGen setting (RGBGen controls your vertex colors) I instead set it to default, which lets the engine try to decide which lighting algorythmn is best. If you have problems with default (you shouldn't), give 'RGBGen lightingdiffuse' a try. That uses lights in the level to dynamically color the vertices of your model.

4) I removed the QER Editorimage - This is only needed on shaders which will be added to world geometry, not to models (unless it's for testing purposes.)


Try this very simple version of your shader, and see if it's happier. If that works, then you can go in and start adding additional commands to the shader to control other things. The best plan with shaders is to always start simple and then work your way into complexity.

- Wyeth
wyeth[ritual] is offline   Reply With Quote
Old 10-07-2003, 01:17 PM   #9
wyeth[ritual]
Casual
 
Join Date: Mar 2001
Location: teh intarnet
Posts: 41
Default Re: Excelsior shaders?

Now on to the Tiki:

It looks like the shader name referenced in your tiki file is not the same as your actual shader name.

I imagine the tiki should look like this:

TIK

TIKI
setup
{
scale 1.0
lod 1 1 1 1 1

path models/vehicle/extest
surface material1 shader models/vehicle/extest/liberty_front
surface material2 shader extest2.tga
surface material3 shader extest3.tga
}
init
{
server
{
setsize "0 -170 -10" "416 169 67"
}
client
{
}
}
animations
{
idle extest1.tan
}


/*QUAKED vehicle_extest_extest-front (0.5 0.25 0.25) (0 0 0) (0 0 0)
extest
*/
wyeth[ritual] is offline   Reply With Quote
Old 10-07-2003, 02:13 PM   #10
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: Excelsior shaders?

wyeth

Thank you for the responses. Concerning the shader post - a couple things:

First, your reductions make sense. And it is good to know about the if/then statements and the default. Also good to know about the lightmap function.

Now at first I still had problems with your code. However, using the 'default' logic you presented, and referencing other tik files which ALWAYS used an existing .tga file name as the name of the shader, I changed the shader name to extest1.tga instead of extest1 (with or without the tga ext). This change made the texture visible in UR and in my test map the glow texture show up too.

Unfortunately I am back to the problem I am trying to avoid. Not only did the extest1_glow.tga 'glow', but so did the extest1.tga. This is exactly what I am trying to prevent (and what we successfully prevented with the brush textures).

What scripting must I use to prevent BOTH textures to glow on the model?

--

Concerning the tik file:

That was a typographical error when posting to the ritual board. In the actual tik file, it read:

surface material1 shader extest_front

and as I note in the earlier part of the post, by changing this to extest1.tga, I got the shader to show up. The problem now is simply making only the glow texture glow.

Any ideas?

(Again thanks ever so much for your assistance here. It has proved extremely valuable) [img]/forums/images/graemlins/laugh.gif[/img]
6of1 is offline   Reply With Quote
Old 10-08-2003, 02:23 AM   #11
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: Excelsior shaders?

OK - I have tried multiple variations on the shader script above:

This produces the exact same effect as the prior script - ie both textures are combined and both textures glow in the dark:

<font color="red">
models/vehicle/liberty/liberty1
{
{
map models/vehicle/liberty/liberty1.tga
rgbGen identity
}
{
map models/vehicle/liberty/liberty1_glow.tga
blendFunc ADD
}
}
</font>
---

This one puts the glow texture on top and makes the white parts of it transparent so one sees the standard texture through it:
<font color="red">
models/vehicle/liberty/liberty1
{
{
map models/vehicle/liberty/liberty1.tga
rgbGen identity
}
{
map models/vehicle/liberty/liberty1_glow.tga
blendFunc FILTER
}
}
</font>
===

and this shader makes both textures transparent but (so far as I can tell at least) also makes them glow. (It is hard to confirm the glow though since the transparency is extreme - ie the textures are very hard to see at all):
<font color="red">
models/vehicle/liberty/liberty1
{
{
map models/vehicle/liberty/liberty1.tga
blendFunc FILTER
rgbGen identity
}
{
map models/vehicle/liberty/liberty1_glow.tga
blendFunc FILTER
}
}
</font>

---

Given the above, I either need a different function besides fliter or add when it comes to blending

- or -

I need the model equivalent of the either (or both) map script commands:

<font color="red">

qer_editorimage models/vehicle/extest/extest1.tga
if novertexlight
{
map $lightmap
rgbGen identity
}
</font>

Any ideas?
6of1 is offline   Reply With Quote
Old 10-08-2003, 10:03 AM   #12
7o'nine
Fanboy
 
7o'nine's Avatar
 
Join Date: Mar 2002
Location: Canada
Posts: 555
Default Re: Excelsior shaders?

Have you tried looking at the Ent-E/Intrepid shaders?
<font color="brown">
models/vehicle/enterprise-e/ent-e-dishtoptop
{
qer_editorimage models/vehicle/enterprise-e/ent-e-dishtoptop.tga
{
map models/sky/UI-ent-dome/env_diffused.tga
rgbGen default
tcGen environment
}
{
map models/vehicle/enterprise-e/ent-e-dishtoptop.tga
blendFunc blend
rgbGen default
}
{
map models/vehicle/enterprise-e/ent-e-dishtoptop_glow.tga
blendFunc add
}
} </font>

The Enterprise does produce the results you want, right? If so, you can use it's shader as a base [img]/forums/images/graemlins/smile.gif[/img]
If you ever want to know how to do something, best thing is to look in EF2 for an example, then search in the files to see how it's done.
For example, the glow shader you asked about before. In SP, there are glow shaders used all over the place, like in drull_interior1... so you check that .shader out.. see what they did.. replace the paths to your own, play around with some values, check out commands in the shaderCommands.txt and also in the Shader Manual(at qeradiant.com) and basically try and patch it together to suit your needs [img]/forums/images/graemlins/smile.gif[/img]

Anyway.. there are slight differences between model and map shaders (such as the $lightmap thing mentioned above)

7
7o'nine is offline   Reply With Quote
Old 10-08-2003, 12:51 PM   #13
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: Excelsior shaders?

7

Actually no - the ent-e shader does not produce the result I want. It makes both textures glow too. (This shader - and the shader for voy - are the first textures I looked at, before I even asked about the brushes issue in the other thread).

What is annoying is I can't find the shader which produces the results I showed for Voy in that pic in the other thread - otherwise I would use that (and what is annoying is I can't find the model I used to produce that pic - so I can't use it to find the shader).

Thus, as you suggest, I *DO* look in EF2 for examples then search the files to see how its done. And then I *DO* experiment with the files to get the right results. (As an example of that, see the multiple test shaders above. For those I do name there are at least three other variations I dont). The problem is always finding the right file. I didn't recall any brushes glowing, so I didn't know what or where to go looking for shaders to emulate. That's why I stayed with model shaders as reference.

Furthermore, I remembered being told that shaders didn't work in ef2 and that light entities were simply applied instead. I now know that this refers to shaders affecting the rest of the map - but see even that misunderstanding comes from ignorance on how this stuff works on a basic level. That is why I consult this forum. Even when it can't answer a question for me, it can point me in a direction which would never have occured to me before - especially after consulting the different manuals. To a noob like me, they are simply more confusing unless one has a direction to follow. Once that direction is presented, it is easier to consult such sources. (I even found a buried ritualistic site that has numerous tutorials and explanations - but as with everything else it has left me with more questions, not less).

Anyway - as I indicate above - the ent-e and voy shaders do not create the effect I am searching for. And I cannot find any shaders which DO produce those results. Are you able to find any model shaders which illuminate only the glow texture and not both textures? Or do you know a shader code which allows that?

As always, thank you for your helpful suggestions. [img]/forums/images/graemlins/smile.gif[/img]
6of1 is offline   Reply With Quote
Old 10-08-2003, 01:31 PM   #14
senkusha
Experienced
 
Join Date: Feb 2001
Location: Wichita Falls, TX
Posts: 113
Default Re: Excelsior shaders?

Try taking a look at the alien-type1a-lurker.tik. I'm not sure if it's what your looking for, but on that model, there is an fx texture that glows in and out in the game. Spawn it in game and see if that's what your going for. Either way, the shaders for the model are in char.shader.

neil
senkusha is offline   Reply With Quote
Old 10-11-2003, 12:27 AM   #15
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: Excelsior shaders?

Ok - I have tried every permutation I can imagine using the advice supplied in all of the above suggestions, but I still cannot produce the effect I am looking for - namely a model in which the first texture does not glow, but the second texture does. Nothing seems to do the trick.

I searched hard through the shader manual as well. Nothing seemed appropriate (that I could tell at least) beyond what has been suggested so far. I thought ONE thing from the shader manual held promise, but it didn't work. The manual made reference to an opposite command to rbgGen lightingDiffuse (which it described when defining what lightingDiffuse means). It said:

Design Note: -rbgGen lightingDiffuse is used when you want the RBG values to be computed for a dynamic model in the world using regular in-game lighting. For example, you would specify on shaders for items, characters, weapons, etc.

This seemed like just the ticket. Unfortunately, the game could not process that shader command. It said it the "-rbgGen" is an unknown parameter. So apparently the command was changed (since characters and weapon models DO seem to adjust to the map brightness and darkness). Does anyone know what this command is now - and if it will create the effect I am trying to achieve?

Can anyone PLEASE help me here?!?!

Perhaps it would be easier to solve this problem by FIRST focusing just on ONE texture instead of combining TWO textures. So - how does one create a shader or texture for a model which does NOT glow (ie does not have light applied evenly across every nook and cranny of the entire model) but instead reacts to the light around it instead?

Any ideas?
6of1 is offline   Reply With Quote
Old 10-11-2003, 11:40 PM   #16
7o'nine
Fanboy
 
7o'nine's Avatar
 
Join Date: Mar 2002
Location: Canada
Posts: 555
Default Re: Excelsior shaders?

I've tried everything I can think of.. but I can't get the same effect on models as brushes. This would most probably be because models don't have lightmaps(as wyeth stated above) so either a model is lit, or it's not.
The rgbGen line probably just estimates what kind of light is in the surrounding area of the model (such as intensity and colour of the light) and then lights the model with that one kind of light.

(the command is rgbGen in EF2, not rbgGen [img]/forums/images/graemlins/smile.gif[/img])

Anyway.. I'm not sure how to get the effect you want [img]/forums/images/graemlins/crazy.gif[/img]

[edit]Looking at hte weapon shaders I see a tcGen angle_based_environment line.. the definition says that "Environment-map this object based on view angles." maybe that has something to do with it?[/edit]

7
7o'nine is offline   Reply With Quote
Old 10-11-2003, 11:56 PM   #17
6of1
Fanboy
 
Join Date: Mar 2002
Posts: 559
Default Re: Excelsior shaders?

I may have resolved this issue - at least enough for what I need. It strange, because I am using code which previously didn't produce the effect I am looking for, but now for some reason does.

See examples in my WIP thread.
6of1 is offline   Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 04:37 AM.


Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.