Elvas Tower: .s file question - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

.s file question Rate Topic: -----

#1 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,339
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 12 June 2019 - 08:54 PM

I'd very much like to be able to blend two textures on the same face, much like what the microtex file does to terrtex files.

With respect to the .s file format, could this be done by assigning an unused numeric value to one or more of the sections and then adding a shader to do the blending?

I don't think it would be too hard to edit the .s file to add the necessary data... Something like this:

shader_names ( 2
named_shader ( TexDiff )
named_shader (newshadername )

)

vtx_states ( 2
vtx_state ( 00000000 0 -5 0 00000002 )
vtx_state ( 00000000 0 -18 0 00000002 )

another prim_state line, etc.

The vertex and uv data would come from a second .s file that only used the overlay texture. It's data woul dhave to be shuffled in VERY carefully.

Is it possible?

#2 User is offline   wacampbell 

  • Member since Nov. 2003
  • Group: Fan: Traction Nuts
  • Posts: 2,345
  • Joined: 22-November 03
  • Gender:Male
  • Location:British Columbia, Canada
  • Country:

Posted 13 June 2019 - 05:42 AM

Multilayer textures are very useful. I have come to depend on them a lot in Railworks eg paint broad brush weathering and shading over a detailed brick or board texture.

The .s file format fully supports multilayer texturing. It seams the .s file designer was thinking ahead to future features. BUTTTT ( and very unfortunately ) none of those features are supported in MSTS or Open Rails ( yet I hope ).

A separate .s file is not needed, a vertex can have multiple uv's.

Here's how it could be done ( by an enhanced 3D exporter, not by hand ):

create a new named shader:

eg  named_shader( TexDiff2Layer )


add a second texture to the tex_idxs section of prim_state:

eg  tex_idxs( 2  0 1 )   // specify the two images


add a second uv operation to uv_ops:

eg
uv_ops ( 2
    uv_op_copy ( 1 0 )  // points to first uv layer in vertex
    uv_op_copy ( 1 1 )  // points to second uv layer in vertex
)


and add additional uv layers to the vertices:

eg vertex_uvs ( 2 233 643 )


I would certainly be willing to modify the Blender exporter to support multilayer texturing if the feature were added to Open Rails and the route editor.

#3 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,339
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 13 June 2019 - 09:49 AM

Wayne, as you may recall I use Sketchup exclusively. It doesn't know anything about multiple textures per face... but it does know how to put two faces in exactly the same space. I imagine other modeling tools do as well. Is that enough of a trick in the modeling tool to provide the raw data to an exporter that can process everything for this sort of result?

#4 User is offline   wacampbell 

  • Member since Nov. 2003
  • Group: Fan: Traction Nuts
  • Posts: 2,345
  • Joined: 22-November 03
  • Gender:Male
  • Location:British Columbia, Canada
  • Country:

Posted 13 June 2019 - 10:31 AM

View PostGenma Saotome, on 13 June 2019 - 09:49 AM, said:

Wayne, as you may recall I use Sketchup exclusively. It doesn't know anything about multiple textures per face... but it does know how to put two faces in exactly the same space. I imagine other modeling tools do as well. Is that enough of a trick in the modeling tool to provide the raw data to an exporter that can process everything for this sort of result?


Technically its possible.

#5 User is offline   Goku 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,785
  • Joined: 12-December 13
  • Gender:Male
  • Simulator:my own
  • Country:

Posted 13 June 2019 - 10:53 AM

MSTS and .s file format supports multiple texture layers. I demonstrated it using terrain shader inside .s files.
Sadly MSTS does not support multiple UV coordinates or I did not find a way to specify it inside .s file.
Or it is possible but not used by MSTS.
I provided my suggestions about it but don't remember where it is.

#6 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,339
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 13 June 2019 - 12:17 PM

Goku, I found the thread where you talked about this... you wrote about blending two textures on a terrain patch. I'd like to do about the same thing within shape files.

Many console games (e.g., Skyrim) appear to be blending textures. For example, one texture to represent a cobble stone street and then a different texture,using different scaling to add grime or bits of greenery. With different scaling you don't see how the two textures individual tile.

In my own work I do a lot of architectural models and one of the more difficult things to do on a very large building (e.g., a huge warehouse) is to get the flat roof to look right. I can apply a texture for roofing stone, or layers of tar paper, but the step and repeat of the texture over a large surface will always show the tiling. I really want to put a second texture over the first that adds grime, water stains and the like but it must be scaled differently or it will just make the problem more obvious.

#7 User is offline   wacampbell 

  • Member since Nov. 2003
  • Group: Fan: Traction Nuts
  • Posts: 2,345
  • Joined: 22-November 03
  • Gender:Male
  • Location:British Columbia, Canada
  • Country:

Posted 13 June 2019 - 12:37 PM

View PostGoku, on 13 June 2019 - 10:53 AM, said:

Sadly MSTS does not support multiple UV coordinates or I did not find a way to specify it inside .s file.
Or it is possible but not used by MSTS.


The .s file supports multiple uvs per my post above. But msts does nothing with it.

#8 User is offline   Goku 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,785
  • Joined: 12-December 13
  • Gender:Male
  • Simulator:my own
  • Country:

Posted 15 June 2019 - 12:14 PM

View PostGenma Saotome, on 13 June 2019 - 12:17 PM, said:

Goku, I found the thread where you talked about this... you wrote about blending two textures on a terrain patch. I'd like to do about the same thing within shape files.

No. I have demonstrated it with shape file, a1t10m track. See here:
First, single texture.
Second, with two textures - second microtex texture.

https://i.imgur.com/R3D41Wf.png

#9 User is offline   Goku 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,785
  • Joined: 12-December 13
  • Gender:Male
  • Simulator:my own
  • Country:

Posted 15 June 2019 - 12:34 PM

View Postwacampbell, on 13 June 2019 - 05:42 AM, said:

uv_ops ( 2
    uv_op_copy ( 1 0 )  // points to first uv layer in vertex
    uv_op_copy ( 1 1 )  // points to second uv layer in vertex
)

This makes "shape failed to load" error in MSTS for me.

But indeed the parameter defines which vertex_uv is used.

This does not cause MSTS error, but still does nothing:
(edit, in fact it does a lot of other crazy things)

uv_ops ( 1
    uv_op_copy ( 2 0 1 )
)


Two UVs doesn't work with Terrain Shader because this shader doesn't use UVs for second texture, but only one float multipler for first texture UVs. I think.

#10 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,339
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 15 June 2019 - 01:45 PM

View PostGoku, on 15 June 2019 - 12:14 PM, said:

No. I have demonstrated it with shape file, a1t10m track. See here:
First, single texture.
Second, with two textures - second microtex texture.

https://i.imgur.com/R3D41Wf.png


Sorry, I didn't find that post.

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users