List of mods using legacy Cg shaders (risk analysis)

only_a_ptr

Infamous Developer
Administrator
Developer
Joined
Jan 31, 2018
Messages
169
Location
Prague, CZ
nVidia Cg toolkit was the go-to shader technology when Rigs of Rods was at peak popularity and most mods were made (circa 2010). But now it's just a proprietary burden that prevents us from migrating to new rendering APIs.

Yesterday there was a debate in Discord#development and while we pretty much agreed we can replace all shaders shipped with the game, we got stuck on the topic of shaders in mods: https://discord.com/channels/136544456244461568/189904947649708032/1150803634913808414. To get us moving forward, I need information: how many mods use them, what kind of mods that is, from what author(s), for what purpose(s), are there the same shaders reused? The point is to find use-patterns so we can devise a plan to convert the mods, possibly (semi)automatically.

At the moment, the only information I have is Mike's claim that "countless mods use them" and I know one mod in particular: The WindmillMountain terrain. It uses them to do custom texture blending on meshes to fake terrain on top of railroad tunnels (which are actually deep cuts in the heightmap, with mesh on top of them). The shaders are named "ET_*" which makes me think they originate in EditableTerrainManager (OGRE 1.6 and prior), but I didn't really investigate.

Our repo is big but not endless, and shaders get reused, so I'm sure we can pinpoint the troublesome ones in reasonable future.
 
- Almost all Sim-Monsters trucks (including SM V5)
- Box5's Unimog 406 and Dodge Rams, plus others
- Gavril Zeta (Zeta X tire material)

SM trucks and Box5's mods appear to use the same NiceMetal shader included with the game, its just defined manually in a material file with duplicated cg/program files. Zeta tire material uses a different shader by "Enterprise-E" (AFAIK).
 
- Auriga terrain: contains a Cg shader file but doesn't use it, probably a leftover from .terrn system. Tested on Windows/DirectX
 
You probably know it but when I was working on RoR bot animations textures of RoR bot are not shown without nVidia Cg toolkit
 
You probably know it but when I was working on RoR bot animations textures of RoR bot are not shown without nVidia Cg toolkit
I didn't realize this but yes, it's because it internally uses managed materials. Those are not a problem however because they ship with the game so I can just rewrite them. I'm only worried about mods bringing their own shaders. Anyway thanks for the note.
 
I was using a cg script to alpha splat buildings for a terrain I was working on, then I gave up fighting with it as there was talk of the new Ogre engine making it out dated.

It let me use RGBA to map high res textures to a low res colour map over the building and then add baked AO over the top as a lightmap. It really allows a lot of flexibility. The only problem was I couldn't get that and normal/bump maps working, which may or may not have been my Linux drivers at the time. Plus learning that DX and OpenGL made the z height go in opposite directions. I can't program cg so was using built in cg and snippets from Ogre site to make it work.

A fixed library of core shaders would be ideal. Help with consistency across vehicles and terrains too.
 
So here is list with all my mods (zips) I got downloaded in: _all-mods.txt, it's 205 files, 4.8 GB.
It's something but surely far from all what is in repository, not to mention archives.
I did a quick search for *.cg files inside those zips (just using DoubleCmd "Find in files" with "Search in archives" checked).
And so in: _cg-common.txt are zips that have any cg files,
I then removed files which only had this set of cg files:
Code:
ETDynLighting.cg
ETShader.program
PSLighting.cg
PSSplat2.cg
PSSplat.cg
VSLodMorph2.cg
VSLodMorph3.cg
VSLodMorph.cg
Which left me a smaller list in: _cg-custom.txt with zips that have (also) some custom cg file(s).
 

Attachments

  • _all-mods.txt
    3.4 KB · Views: 26
  • _cg-common.txt
    743 bytes · Views: 30
  • _cg-custom.txt
    549 bytes · Views: 30
Back
Top