Texture trick/method on old classic models
Valaktik opened this issue ยท 1 comments
Heyllo
I noticed special texture details on classic rolling stock that could be usefull for current content creators.
Some normal boxes have their texture rescaled in height and in width but it only appears in game :
I first saw that when converting the HST.
As you can see, the green box, which is a just normal box, have it's texture upscaled in height and a bit less upscaled in width. And it results on a great looking head light.
Same with the blue box, it results on a nice coupler.
For the orange box, 1 box that goes side to side, it's only rescaled a little in width but idk why... Maybe for the shine effect ?
And there are lots of other rolling stock using this :
I really would like creators to be able to use that thing, so I tried to find how it works.
It's not in the .java file of the models... The head light on the HST is box 36 :
box36 = new CustomModelRenderer(this, 217, 5, 256, 256);
box36.addBox(0F, 0F, 0F, 2, 4, 4);
box36.setPosition(-36F, 18F, -2F);
textureX and Y are as every other boxes of the model...
I learnt that ModelRendererTurbo contructor has textureU and V parameter and CustomModelrenderer does not. Maybe it's there ?
There is also the generateFaces() method in CustomModelRenderer that has textureWidth and Height parameters but I'm not skilled enough in coding to understand all that. x]
Those texture scaling tricks have to be done by hand in the code.
It's an interesting concept, but honestly no one is gonna go to the length of editing that stuff by hand, especially given how few people even understand these systems, or even basic syntax for that matter.
As for CustomModelRenderer, the current implementation of it is nothing more than a translator to convert the old FMC values to Flans (ModelRendererTurbo).
If you notice, CustomModelRenderer extends ModelRendererTurbo, meaning it inherits everything of ModelRendererTurbo, and only changes what is annotated with @OverRide.
Here's a rough explanation of the variables, to show where things are going, like the seemingly missing UV mapping.
box36 = new CustomModelRenderer(this, 217, 5, 256, 256);//Host model Instance, U, V, Width, Height
box36.addBox(0F, 0F, 0F, 2, 4, 4);//Offset X, Y, Z, Dimension X, Y, Z
box36.setPosition(-36F, 18F, -2F);// Position X, Y, Z