Rain on Cab effect

I get some results but my windshield is always untransparent, so I don’t see anything trough it. <!– s:? –><img src="{SMILIES_PATH}/icon_e_confused.gif" alt=":?" title="Confused" /><!– s:? –> <!– s:twisted: –><img src="{SMILIES_PATH}/icon_twisted.gif" alt=":twisted:" title="Twisted Evil" /><!– s:twisted: –>

<!– m –><a class="postlink" href="http://www.youtube.com/watch?v=8bja2rfNunY">http://www.youtube.com/watch?v=8bja2rfNunY</a>&lt;!– m –>

[b:3ai0e9fg]Bingo![/b:3ai0e9fg] <!– m –><a class="postlink" href="http://www.youtube.com/watch?v=B7vmAjAEmsA">http://www.youtube.com/watch?v=B7vmAjAEmsA</a>&lt;!– m –>
The red lines must be there… So, the first texture must appear twice!

[quote:3ai0e9fg]&lt;ShaderName d:type=&quot;cDeltaString&quot;&gt;TrainGlassWeatherEffects.fx&lt;/ShaderName&gt;
&lt;TextureByName&gt;
[color=#FF0000:3ai0e9fg]&lt;e d:type=&quot;cDeltaString&quot;&gt;textures[00]windiff_nm&lt;/e&gt;[/color:3ai0e9fg]
&lt;e d:type=&quot;cDeltaString&quot;&gt;textures[00]windiff_nm&lt;/e&gt;
&lt;e d:type=&quot;cDeltaString&quot;&gt;textures[00]winnorm_nm&lt;/e&gt;
&lt;e d:type=&quot;cDeltaString&quot;&gt;textures[00]winwmotion_nm&lt;/e&gt;
&lt;/TextureByName&gt;
&lt;Name d:type=&quot;cDeltaString&quot;&gt;weatherglass_1&lt;/Name&gt;
&lt;CollisionSurface d:type=&quot;cDeltaString&quot;&gt;METAL&lt;/CollisionSurface&gt;
&lt;VertexType d:type=&quot;ref&quot;&gt;166072312&lt;/VertexType&gt;
&lt;FrameAlphaMode d:type=&quot;cDeltaString&quot;&gt;ALPHA_MODE_NONE&lt;/FrameAlphaMode&gt;
&lt;PassPlatformData/&gt;
&lt;FloatParam&gt;
&lt;cHcEffectMaterialDx-cFloatParam d:id=&quot;165974308&quot;&gt;
&lt;Name d:type=&quot;cDeltaString&quot;&gt;SPECULARPOWER&lt;/Name&gt;
&lt;Value d:type=&quot;sFloat32&quot; d:alt_encoding=&quot;0000000000000000&quot; d:precision=&quot;string&quot;&gt;0.0000&lt;/Value&gt;
&lt;/cHcEffectMaterialDx-cFloatParam&gt;
&lt;cHcEffectMaterialDx-cFloatParam d:id=&quot;165974320&quot;&gt;
&lt;Name d:type=&quot;cDeltaString&quot;&gt;CUSTOMPARAM0&lt;/Name&gt;
&lt;Value d:type=&quot;sFloat32&quot; d:alt_encoding=&quot;0000000000000000&quot; d:precision=&quot;string&quot;&gt;0.0000&lt;/Value&gt;
&lt;/cHcEffectMaterialDx-cFloatParam&gt;
&lt;cHcEffectMaterialDx-cFloatParam d:id=&quot;165974332&quot;&gt;
&lt;Name d:type=&quot;cDeltaString&quot;&gt;CUSTOMPARAM1&lt;/Name&gt;
&lt;Value d:type=&quot;sFloat32&quot; d:alt_encoding=&quot;0000000000000000&quot; d:precision=&quot;string&quot;&gt;0.0000&lt;/Value&gt;
&lt;/cHcEffectMaterialDx-cFloatParam&gt;
&lt;cHcEffectMaterialDx-cFloatParam d:id=&quot;165974344&quot;&gt;
&lt;Name d:type=&quot;cDeltaString&quot;&gt;CUSTOMPARAM2&lt;/Name&gt;
&lt;Value d:type=&quot;sFloat32&quot; d:alt_encoding=&quot;0000000000000000&quot; d:precision=&quot;string&quot;&gt;0.0000&lt;/Value&gt;
&lt;/cHcEffectMaterialDx-cFloatParam&gt;
&lt;cHcEffectMaterialDx-cFloatParam d:id=&quot;165974356&quot;&gt;
&lt;Name d:type=&quot;cDeltaString&quot;&gt;CUSTOMPARAM3&lt;/Name&gt;
&lt;Value d:type=&quot;sFloat32&quot; d:alt_encoding=&quot;0000000000000000&quot; d:precision=&quot;string&quot;&gt;0.0000&lt;/Value&gt;
&lt;/cHcEffectMaterialDx-cFloatParam&gt;
&lt;cHcEffectMaterialDx-cFloatParam d:id=&quot;165974368&quot;&gt;
&lt;Name d:type=&quot;cDeltaString&quot;&gt;CUSTOMPARAM4&lt;/Name&gt;
&lt;Value d:type=&quot;sFloat32&quot; d:alt_encoding=&quot;0000000000000000&quot; d:precision=&quot;string&quot;&gt;0.0000&lt;/Value&gt;
&lt;/cHcEffectMaterialDx-cFloatParam&gt;
&lt;cHcEffectMaterialDx-cFloatParam d:id=&quot;165974380&quot;&gt;
&lt;Name d:type=&quot;cDeltaString&quot;&gt;CUSTOMPARAM5&lt;/Name&gt;
&lt;Value d:type=&quot;sFloat32&quot; d:alt_encoding=&quot;0000000000000000&quot; d:precision=&quot;string&quot;&gt;0.0000&lt;/Value&gt;
&lt;/cHcEffectMaterialDx-cFloatParam&gt;
&lt;/FloatParam&gt;
&lt;VectorParam&gt;
&lt;cHcEffectMaterialDx-cVectorParam d:id=&quot;165974504&quot;&gt;
&lt;Name d:type=&quot;cDeltaString&quot;&gt;AMBIENT&lt;/Name&gt;
&lt;Value d:numElements=&quot;4&quot; d:elementType=&quot;sFloat32&quot; d:precision=&quot;string&quot;&gt;1.0000 1.0000 1.0000 1.0000&lt;/Value&gt;
&lt;/cHcEffectMaterialDx-cVectorParam&gt;
&lt;cHcEffectMaterialDx-cVectorParam d:id=&quot;165974528&quot;&gt;
&lt;Name d:type=&quot;cDeltaString&quot;&gt;EMISSIVE&lt;/Name&gt;
&lt;Value d:numElements=&quot;4&quot; d:elementType=&quot;sFloat32&quot; d:precision=&quot;string&quot;&gt;0.0000 0.0000 0.0000 1.0000&lt;/Value&gt;
&lt;/cHcEffectMaterialDx-cVectorParam&gt;
&lt;cHcEffectMaterialDx-cVectorParam d:id=&quot;165974552&quot;&gt;
&lt;Name d:type=&quot;cDeltaString&quot;&gt;SPECULARCOLOR&lt;/Name&gt;
&lt;Value d:numElements=&quot;4&quot; d:elementType=&quot;sFloat32&quot; d:precision=&quot;string&quot;&gt;1.0000 1.0000 1.0000 1.0000&lt;/Value&gt;
&lt;/cHcEffectMaterialDx-cVectorParam&gt;
&lt;cHcEffectMaterialDx-cVectorParam d:id=&quot;165974576&quot;&gt;
&lt;Name d:type=&quot;cDeltaString&quot;&gt;DIFFUSECOLOR&lt;/Name&gt;
&lt;Value d:numElements=&quot;4&quot; d:elementType=&quot;sFloat32&quot; d:precision=&quot;string&quot;&gt;1.0000 1.0000 1.0000 1.0000&lt;/Value&gt;
&lt;/cHcEffectMaterialDx-cVectorParam&gt;
&lt;/VectorParam&gt;
&lt;AlphaTestType d:type=&quot;cDeltaString&quot;&gt;HC_ALPHATEST_ALWAYS&lt;/AlphaTestType&gt;
&lt;AlphaRef d:type=&quot;sUInt32&quot;&gt;127&lt;/AlphaRef&gt;
&lt;TwoSided d:type=&quot;bool&quot;&gt;0&lt;/TwoSided&gt;
&lt;MipLodBias&gt;
[color=#FF0000:3ai0e9fg]&lt;e d:type=&quot;sFloat32&quot; d:alt_encoding=&quot;00000000000000C0&quot; d:precision=&quot;string&quot;&gt;-2.0000&lt;/e&gt;[/color:3ai0e9fg]
&lt;e d:type=&quot;sFloat32&quot; d:alt_encoding=&quot;00000000000000C0&quot; d:precision=&quot;string&quot;&gt;-2.0000&lt;/e&gt;
&lt;e d:type=&quot;sFloat32&quot; d:alt_encoding=&quot;000000000000F0BF&quot; d:precision=&quot;string&quot;&gt;-1.0000&lt;/e&gt;
&lt;e d:type=&quot;sFloat32&quot; d:alt_encoding=&quot;0000000000000000&quot; d:precision=&quot;string&quot;&gt;0.0000&lt;/e&gt;
&lt;/MipLodBias&gt;[/quote:3ai0e9fg]

More details tomorrow. I’m tired now.

Regards
Vlado

Thanks vlado – the second diff texture is actually replaced by one generated at run time (cubic env map) it just needs a slot.

I’ll see what I can do – probably not today.

There might be a file called shaders.txt somewhere in the RW folders – it would be handy to get an up to date copy (I don’t have Rail Works)

Many thanks guys for the combined brainpower on this. And especially Paul, for the updated exporter, which I will try tonight. I’ll also look for that shaders file for you. Although there is a list of new shaders somewhere at uktrainsim I seem to remember.

Vlado, just looked at your video – brilliant you have the wipers working as well! Were your winnorm and wmotion textures just Normal files or did you do something else with them?

Richard

[b:2hk5cxt9]Here are[/url:2hk5cxt9][/b:2hk5cxt9] my textures that I used on my model of cab. I copied parts from [b:2hk5cxt9]normal texture of SD40-2[/url:2hk5cxt9][/b:2hk5cxt9] and paste it to my.

I got to next conclusions. All 3 textures must have alpha.

[img:2hk5cxt9]http&#58;//img851&#46;imageshack&#46;us/img851/7254/canvasgrz&#46;png[/img:2hk5cxt9]

[b:2hk5cxt9]windiff_nm[/b:2hk5cxt9] is basic diffuse texture with alpha.

[b:2hk5cxt9]winnorm_nm[/b:2hk5cxt9] is normal texture. Glasses are painted in different colors. I don’t know why. I tried with blue and &quot;pink&quot;. Blue is windshield, &quot;pink&quot; is side glass. On normal texture alpha determine where will rain drops appear. Black – no rain drops, White – there are rain drops.

[b:2hk5cxt9]winwmotion_nm[/b:2hk5cxt9] is texture that cleans rain drops. On the way of wiper blades we have yellow color and fade from violet to the blue. I don’t know for what are this two colors and why there are two of them. I took yellow part only. I tried without colors too (only white) and rain drops are cleaned without problems. Alpha is below yellow color. Alpha must be fade from black to white and black must be on the side of wiper blades while it’s still. I mean rain drops starts to wipe off from black side of fading alpha.
Here I need to mention that you must have white colors everywere where wipers don’t go because if not, rain drops will be wiped off on places where wipers don’t go too.

In Blueprint of engine in section &quot;Wiper pair&quot; it needs to be writen like on the picture. In fields of &quot;Slave to animation&quot; A and B needs to be writen name of your IA file (without extension). For example, my animation file is [b:2hk5cxt9]wipers.IA[/b:2hk5cxt9]. I don’t know why A and B fields even exist.

[img:2hk5cxt9]http&#58;//img23&#46;imageshack&#46;us/img23/9082/engineblueprint&#46;png[/img:2hk5cxt9]

I hope I helped you.

Vlado

Thank you so much for such a detailed reply. I will go and try that now and hopefully it will work for me to. <!– s:) –><img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" /><!– s:) –>

Regards

Richard Scott

&quot;PaulGausden&quot;:5tu9ikc0 wrote:
There might be a file called shaders.txt somewhere in the RW folders – it would be handy to get an up to date copy (I don’t have Rail Works)[/quote:5tu9ikc0]

The file has the texture description that I quoted above.

Thanks Paul, Vlado and RichardScott for the coding and tests.

sadly, still not qute there. I cannot get the wipers to clean the windscreen. although I have rain on the window.

I have followed all the procedure with no luck. I’ve even substituted Vlados textures for mine, as we know they work. Vlado, can I confirm that you made a separate windscreen model on top of the normal one and that this is the one textured TrainGlassWeather Effects and called weatherglass_1? Also I made mine single sided, as there seemed no need for ‘glass’ to face outwards in cab model, is that the same as you? The alphas for the main texture and the normal seem to be one shade of grey all over, rather than matching the shape of the wiper area, is that correct?

I am so pleased that you have made it work, it gives me hope that I will get there eventually as well! <!– s:) –><img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" /><!– s:) –>

Richard

I would like to see your textures, GeoPcDx and cab.xml from source folder. Can you zip it and send to me?
P.S. I haven’t separate windshield model.

&quot;Vlado&quot;:1sk6ytd8 wrote:

P.S. I haven’t separate windshield model.[/quote:1sk6ytd8]

So you used the existing windscreen face and assigned TrainGlassWeatherEffects to it + all 3 the textures (no duplication of the windscreen face).

[quote:2wb5a5zl]I would like to see your textures, GeoPcDx and cab.xml from source folder. Can you zip it and send to me?
P.S. I haven’t separate windshield model.[/quote:2wb5a5zl]

I will sort that out tonight, when I’m home. I did wonder if you could zip up the three aces you used so I could try them. I feel it is in my textures rather than the RW files that the problem lies. I use the Photoshop plugin to create ace files, what do you use?

I assumed there was a separate windscreen model as, when looking at the cab GeoPcDx file I could see an object using TrainGlass as well as one using TrainGlassWeatherEffects, but it obviously works for you. I assume it looks ok, when its not raining? I did actually try this last night, just in case, but it still didn’t work.

Many thanks for your support, I will get back to you.

Richard

&quot;DOM107&quot;:2gvuzz8h wrote:
So you used the existing windscreen face and assigned TrainGlassWeatherEffects to it + all 3 the textures (no duplication of the windscreen face).[/quote:2gvuzz8h]That’s right.

&quot;RichardScott&quot;:2gvuzz8h wrote:
I use the Photoshop plugin to create ace files…[/quote:2gvuzz8h]Me too.

Regards
Vlado

Hi Vlado

Here is a zip with the texture files. I’ve sent them as tga files, so you can see if I’ve got my alpha correct. I forgot about the attachment limit here, so cannot send the geopcdx until tomorrow (when I have access to a site to ftp it to). I have however, included a text file extract that shows the TrainGlassWeatherEffects section, it might help for now. Also the cab camera xml and engine Bin.

Thank you so much for looking at these for me. I really hope you can spot that I’ve done something simple and silly <!– s:D –><img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy" /><!– s:D –> , so I can get it to work. By the way, I did change the model so that there is only one windsceen model, as you have done. Also, in wiperpairs in the engine blueprint, I think the reference is to the animation id, not the ia name?

Remember I’ve also tried it with your textures and it didn’t work then either.

Thanks again. Regards

Richard

Richard, your PCCWinwmotion_nm texture is bad. Your white on RGB channel and alpha channel is not 100% white. Also, your range is not from black to white, your is from gray to white. Very important that fade must be from 100% black to 100% white. In attachment is repaired texture. [b:3tgvnvfd]In fields of &quot;Slave to animation&quot; A and B is reference to your animation file and there must be only name of your IA file (without extension), not path to it.[/b:3tgvnvfd]

Hi Vlado

Thank you so much. I cannot try this until tonight, but what you say makes sense.

How do you make the winmotion texture? Do you use a graduated fill or manually draw it? I use Paint Shop Pro and Photoshop.

Thank you again, for giving me your time on this.

Richard

You must be logged in to reply in this thread.

89 posts