Page 1 of 1

Base Textures

Posted: 06 May 2016, 22:16
by PicassoCT
Hi this is a quick and dirty tutorial to DefaultTextures,

1. What are DefaultTextures ?
As the name allready says, they are basic Texture-shaders, bundled with base Content. Its all based on Smoths Lua-Texture-Shader.
There are four of them at the Moment:
  • Rubber
    Renders a Object as a black rubber like type
    Iron:
    Shows a object as a single piece of perfect iron.
    Color:
    Renders the whole piece, in the specified colour and second colour. Usefull for Gunports and Lights.
    PaintedMetall:
    Renders a piece, per quad as Coloured Textured surface, with the borders beeing abbrassed by use
    TeamPaintedMetall:
    Same as PaintedMetall but in Team Colour
Now how does this apply to your game?

First you need a model, thats several seperate pieces.
Do not specify a texture for your unit in UpSpring or Blender.
Now go into the Unitdef of the unit that uses the model.
Create a Tag called CustomParams={} if you did not see one allready.
Inser the following Code into the CustomParams Table.

Code: Select all

 CustomParams={
DefaultTexture={
   ["TankWhee2"]="Rubber",
   ["TankWhee1"]="Rubber",
   ["TankWhee3"]="Rubber",
   ["TankWhee4"]="Rubber",
   ["TankBody"]={type="PaintedMetall", colour={r=128,g=128,b=128}}
   ["TankTop"]="TeamPaintedMetall"
}
} 
The naming convention is fairly obvious. Its Piecename= TypeOfTextureShader to apply.
One final information- the painted Metall TextureShader is applied per Quad, which means, it will look better, if that part of the modell consists of relative huge polygons. Of course the same System can be applied to features, within the limitation, that every feature consists of just one piece.

DefaultTextureShaders are part of Spring 103.0 upwards.


Have fun making your own game. Its easy again.
PS: Will update with photos later.

Thanks goes to smoth and gajop.

If you got any questions, post them below.

Re: Base Textures

Posted: 07 May 2016, 01:08
by smoth
What did I do? I don't know what this is about/for

Re: Base Textures

Posted: 07 May 2016, 01:23
by gajop
smoth wrote:What did I do? I don't know what this is about/for
Image

Re: Base Textures

Posted: 07 May 2016, 01:26
by smoth
I am confused but there is nothing irregular there.

Re: Base Textures

Posted: 07 May 2016, 09:41
by PicassoCT
Getting beginners with more then tutorial videos on board- might be worth-while :D
And you contribooted with that per Piece-Texture-Shadder Smoth.
The glue-code has just not dryed yet.

Re: Base Textures

Posted: 08 May 2016, 04:50
by smoth
The shader it's self was mostly peet and beherith. I just wrote the code to do the underworkings for color assignment etc. It's a lot of work and I did tweak the shader here and there but the shader was peet and behe

As far as peice shader, the thing where you attach model that was pressureline and jk I believe

Re: Base Textures

Posted: 08 May 2016, 11:52
by PicassoCT
We might get some of the ease of use back after all, that kicked spring into over-drive back then.
This Open MSPaint, put the files in a folder, hit the exe and play on it- easyness.

If someone can texture a model, by simply putting it into the Folder, naming the pieces and be done with it. Thats a archievment unlocked.

+1 for Base Textures becoming part of BaseContent

Re: Base Textures

Posted: 14 May 2016, 20:25
by Karl
So that means you don't need a UV-mapped models anymore for this? Also does this shader work okayish/average on triangle faces?

Re: Base Textures

Posted: 14 May 2016, 21:15
by PicassoCT
Yes - smoth and gajop rock :D

Re: Base Textures

Posted: 14 May 2016, 21:18
by Karl
Interesting... I think I will give it a go soon. So that shader thing if I understand right is already added in Spring 103? Very well, sounds like a upgrade from 3do texturing method.

Re: Base Textures

Posted: 18 May 2016, 11:17
by Forboding Angel
Add pics so we can verify that it happened?

Re: Base Textures

Posted: 24 May 2016, 17:40
by code_man
I would love to test this asap.