Shaders and Textures in 3D Canvas

Fire up your 3D modelling tool and start building some rolling stock, or find out what others are previewing here. If you have questions about how to make the blueprints work or what names mean what in models, here's the place to find out your answers.

Moderator: Moderators

Locked
User avatar
jonathanmlewis
Established Forum Member
Posts: 390
Joined: Wed Apr 30, 2003 4:22 pm
Location: Berkshire
Contact:

Shaders and Textures in 3D Canvas

Post by jonathanmlewis »

I have been building my US SD40T-2 for over 2 years now. I have more or less now completed the model and it loads fine just with basic textures in RW thanks to some previous help here. However I am trying to add shaders/improve textures so I can finally finsh it of.

Despite spending the last 2 days playing around with TrainSpecEnvMask.fx and TrainBumpSpecEnvMask.fx I still do not seem to be able to get any results which are any good. Is there another shader which is easier to get good results from?

TrainSpecEnvMask.fx seems to make it look far too white/shiny however dark the textures/aplha map is. TrainBumpSpecEnvMask.fx seems to do nothing apart from at strange angles when it goes back to being too white/shiny like TrainSpecEnvMask.fx. However I'm not too sure what should be on the bump map should it just be dumy texture ior should it be something more the tutorial by Kevin Martin and Richard Scott does not make it very clear. I have also changed Diffuse/Ambient/Specular settings.

I am hoping another 3D Canvas user will be any to help me out with what the best way is to get good looking textures or that I can be pointed in the direction of a tutorial however I think I have read most of them.

Thanks for any help you may be able to give.
User avatar
RichardScott
Established Forum Member
Posts: 312
Joined: Tue Nov 27, 2001 12:00 am
Location: Dorset, England

Re: Shaders and Textures in 3D Canvas

Post by RichardScott »

Hi Jonathan

I actually use TrainBumpEnvMask.fx most of the time, this still allows bump and 'shiny' effects.

I don't know what graphics program you are using, but I use Paint Shop Pro usually (version 7, which I think was the best). Alpha is added to the main texture - the more black the less shine. When you add the alpha, you create it in the Mask menu, but then save it to Alpha channel and delete it from the picture (do not merge). Then load it from alpha in the Selection menu. I don't know about this in other programs I'm afraid.

In Canvas, as well as your main texture, the dummy texture is loaded in the environment map slot (blue sphere) and the Normal or Bump Map in the Bump slot (of course). You can also use the first slot (Miscellaneous) to add grey and darken the texture in the sim. If the Alpha is not making any difference, then you may possibly be using the original RW exporter. If you use Decapod's newer Canvas exporter, this handles the range of shades in the alpha channel much better (including translucency). With this exporter though it is very important to include the dummy texture and bump map in all shaders using Bump and Env in their name. Any shader using .fx has to have a dummy texture. Otherwise the export seems ok, but crashes the blueprint editor.

Incidentally, I use Photoshop Elements to create the Bump/Normal file using the NVidea Normal Plugin for Photoshop (I also use Elements to save Aces). However, a simple Bump can be created by making a monochrome version of your texture, where black equals depth (in other words, a rivet would be a white shape on a dark area to appear 'raised'. A Normal map is more complicated, using a range of shades to create relief. Also remember, once you start playing with alphas, you should save a bmp and a tga version of each texture. The bmp is used in Canvas and the tga is the one used to export to Ace. If you use the tga in Canvas, you may find parts going transparent, as Canvas assumes that's what the alpha is for!

The easiest way to check all this is to right click on the part in Canvas and select properties, you can then make sure all textures are in the right slot and you have the shader name in the Rail Sim field (click in a slot to change it, or add the name). I'm sure all this is known to you, but I thought I'd write down everything I do. If this still doesn't work, feel free to send me one of your textures and I will add an alpha, return it to you and see if that is the problem, or Canvas.

Hope this is of some help.

Regards

Richard Scott
User avatar
jonathanmlewis
Established Forum Member
Posts: 390
Joined: Wed Apr 30, 2003 4:22 pm
Location: Berkshire
Contact:

Re: Shaders and Textures in 3D Canvas

Post by jonathanmlewis »

Hi Richard,

Thanks for your response been of great help since all the offical tutorials are all about 3D Studio Max. I never really understood before 3 different textures were reqired the actual texture/specular map/bump map. I've had a few hours this evening and seem to be getting better results now I know what each texture should include. However am currently using the defualt canvas exporter as I can not find Decapod's newer exporter for 7.1.2 however I also have verison 8.2 which does have it but it does'nt seem to work but other people are having the same problem with V 8.2 looking at the forum here and the amabillis forum.
Where can Decapod's newer exporter for verison 7.1.2 be downloaded from?

The lightness on each side should be determined in the game by the specular map which is the same for both textures however I get the following in RW (I know some of the textures are rubbish at the moment but still a W.I.P.)
Image
The side without the sun on (the right screenshot) is much brighter than the side with the sun on (left). I'm guessing this is something to do with my specular map or a problem with the default exporter?


Thanks
User avatar
RichardScott
Established Forum Member
Posts: 312
Joined: Tue Nov 27, 2001 12:00 am
Location: Dorset, England

Re: Shaders and Textures in 3D Canvas

Post by RichardScott »

Hi Jonathan

Paul Gausden's (Decapod) exporter is part of his plugins set at:

http://www31.brinkster.com/decapod/plugins601.htm

If you haven't already got any of these, they will revolutionise your work with Canvas!

Make sure you get the right version for the Canvas you use. I haven't switched to Version 8 yet, until its all working as well as 7 (I'm sure it will be better when it is at that stage).

Re the dark-light problem, setting the base colour (the miscellaneous slot in Canvas) to a darker grey may help. Although it will also make seeing it in Canvas harder, so leave that to the end usually. I also forgot to say. When naming your Bump or Normal files add _nm to the end of the file name. I think this is to stop it compressing when saved, or somthing like that.

Do keep asking, if things are still not clear. Its great to see another loco builder join the ranks.

Cheers

Richard
User avatar
jonathanmlewis
Established Forum Member
Posts: 390
Joined: Wed Apr 30, 2003 4:22 pm
Location: Berkshire
Contact:

Re: Shaders and Textures in 3D Canvas

Post by jonathanmlewis »

Thanks for that I had tried before but I had a old version of Canvas so had to upgrade to 7.1.2. The new exporter does seem to be giving far better results :)

I have a few more questions....

Since using the new exporter the alpha has disapeared from the numbers so every number has a orange background? I am guessing this is as I am not using the correct shader?

I also do not fully understand how to get head/tail lights to work. I have added a quad for the lights called 'lights_fwdhead' to 'lights4_fwdhead' with the Shader 'AddTex' however they used appear like any object in KRS. I must be doing something wrong here...

Thanks for your help so far I'm starting to get the hand of it now. Anyway below is a screenshot its nice to see it running after spending over 2 years in development.
Image

Thanks
User avatar
RichardScott
Established Forum Member
Posts: 312
Joined: Tue Nov 27, 2001 12:00 am
Location: Dorset, England

Re: Shaders and Textures in 3D Canvas

Post by RichardScott »

Hi

Already looking good!

Re the numbers:

Shader is: TrainBasicObjectDiffuse.fx on the Primary digits objects

But remember to add the word Transparency in the TxAlpha field, it does seem to make a difference. Also, of course, as the shader has .fx you need a dummy texture in the environment slot.

The lights are named as (and here Front means the front of the train model, not the direction its travelling, if that makes sense):

lights_fwdhead - is the front headlight
lights_revtail - is the red light at the front
lights_fwdtail - is the red light at the rear
lights_revhead - is the back headlight

At least I think that's right. And you can add extras by adding numbers, as you have done. e.g lights2_fwdhead

Shader is AddTex - make sure the ace for this is exported with alpha, of course.

With both the numbers and the lights, I have sometimes found that you need to delete the loco from the scenario and load it afresh to get changes to take effect.

Cheers

Richard
User avatar
eyore
Very Active Forum Member
Posts: 1226
Joined: Tue Jan 27, 2004 6:22 pm
Location: Cumbrian hills

Re: Shaders and Textures in 3D Canvas

Post by eyore »

Richard suggested the following
snip
RichardScott wrote: Shader is: TrainBasicObjectDiffuse.fx on the Primary digits objects

But remember to add the word Transparency in the TxAlpha field, it does seem to make a difference. Also, of course, as the shader has .fx you need a dummy texture in the environment slot.

Shader is AddTex - make sure the ace for this is exported with alpha, of course.
I think you might find that TexDiff would be better than TrainBasicObjectDiffuse.fx as its not an .fx shader so you won't need the dummy texture in the environment slot. You still need transparency in the TxAlpha field though.

The other shader should be AddATex not AddTex.

Hope that helps?
Phil

Image
User avatar
RichardScott
Established Forum Member
Posts: 312
Joined: Tue Nov 27, 2001 12:00 am
Location: Dorset, England

Re: Shaders and Textures in 3D Canvas

Post by RichardScott »

Hi Phil

I'm assuming you say that because it works for you, so I'm interested to know that. I can only say what works for me and TrainBasicObjectDiffuse.fx does. I guess I picked it up from somewhere and stuck with it and its worked for all my models uploaded here.

However, regarding the light texture - This is from the RSDL Train Guidelines:

"For head and tail light glows, make simpled quads and apply 64x64 or even 32x32-
pixel 24-bit textures are to be used and their material set to AddTex."

I think AddAtex is the one for scenery items like lamps lighting up at night.

Anyway, all contributions here welcome.

Cheers

Richard
User avatar
eyore
Very Active Forum Member
Posts: 1226
Joined: Tue Jan 27, 2004 6:22 pm
Location: Cumbrian hills

Re: Shaders and Textures in 3D Canvas

Post by eyore »

RichardScott wrote:Hi Phil

I'm assuming you say that because it works for you, so I'm interested to know that. I can only say what works for me and TrainBasicObjectDiffuse.fx does. I guess I picked it up from somewhere and stuck with it and its worked for all my models uploaded here.

However, regarding the light texture - This is from the RSDL Train Guidelines:

"For head and tail light glows, make simpled quads and apply 64x64 or even 32x32-
pixel 24-bit textures are to be used and their material set to AddTex."

I think AddAtex is the one for scenery items like lamps lighting up at night.

Anyway, all contributions here welcome.

Cheers

Richard
Hi Richard,

Yes, the Texdiff works for me and I mentioned it because of the saving on draw calls.

With regard to the AddTex, you are absolutely right and I bow my head in shame for my misleading comment. :-?
Phil

Image
User avatar
RichardScott
Established Forum Member
Posts: 312
Joined: Tue Nov 27, 2001 12:00 am
Location: Dorset, England

Re: Shaders and Textures in 3D Canvas

Post by RichardScott »

No problem at all. And your comment about TexDiff made me do some searching and I see elsewhere, someone using TexDiff found the numbers less bright. So I may well look into changing - so thanks.

Richard
User avatar
longbow
Very Active Forum Member
Posts: 3608
Joined: Mon Mar 18, 2002 12:00 am
Location: Noosa, Australia
Contact:

Re: Shaders and Textures in 3D Canvas

Post by longbow »

But remember to add the word Transparency in the TxAlpha field, it does seem to make a difference.
Just to confirm that this entry is needed to create a transparency with the new igs exporter whereas it was not before. This change baffled me for a while before I found this thread.
User avatar
jonathanmlewis
Established Forum Member
Posts: 390
Joined: Wed Apr 30, 2003 4:22 pm
Location: Berkshire
Contact:

Re: Shaders and Textures in 3D Canvas

Post by jonathanmlewis »

longbow wrote: Just to confirm that this entry is needed to create a transparency with the new igs exporter whereas it was not before. This change baffled me for a while before I found this thread.
That was indeed the problem.

Not had that much time to spend on it for a few days but I have now fixed all the known problems :). Thanks to everyone who has helped me especially Richard Scott or I would not of made any progress. I hope to finsh the model off over the next few days.
User avatar
RichardScott
Established Forum Member
Posts: 312
Joined: Tue Nov 27, 2001 12:00 am
Location: Dorset, England

Re: Shaders and Textures in 3D Canvas

Post by RichardScott »

Jonathan

Glad its worked out and look forward to seeing the model.

Paul's newer igs exporter is less forgiving in some ways (in other words, does it properly!), but produces so much better results and means the whole alpha issue is much easier now. Remember also, enter Translucency if you want that effect and not just transparent.

Cheers

Richard
Locked

Return to “[RW] Building Rolling Stock”