• Welcome to PiBoSo Official Forum. Please login or sign up.
 
December 13, 2019, 11:15:16 pm

News:

GP Bikes beta16b available! :)


Shaders explanation

Started by pleclair, May 04, 2015, 11:02:47 pm

Previous topic - Next topic

pleclair

I have search every forums for informations on shaders... and its very shady (pun intended) at best. 

gpb/wrs have nothing on the matter, and kart have some. 

I have found this thread, that was linked in the track resources: http://forum.kartracing-pro.com/index.php?topic=1739.0, but really, its only some simple examples... this won't make any converted track from AC look anywhere near the original.  Plus, it doesnt really explain how it all works, all the possible definition you can add in the .shd file... if we are to create race tracks that looks anywhere near what piboso's is making.. then we must have this information.  AC and rF2 dont hide anything about their shaders... you select one, configure it, add the maps, and you see the result. 

So I'm grasping a bit how it works... if I understood properly, I must create a .shd file named as my diffuse texture, and it must be in the same directory.  But... where is that?  I mean, the textures are in the .map file, right?  So, do I really need to export the map file from Max everytime I want to change a shader?  Cause figuring out how it works and how to get the results I want, I will have to make many tries, and this whole workflow seems very unproductive.. so I doubt it is the way it works. 

I'm looking at victoria, and I cannot find any shd file, so they must be as I think in the map file.  Any way to crack open a map file?  I could look at the shd of victoria and pick it up very quickly.

So basically, it woud be really nice if piboso could details everything that can go into the shd file. 

I mean, from the simple example in that thread, to the track creation rules... I see no way of doing some basic detail mapping..  having a low res diffuse + an high res detail on a different uv channel + normal + spec. 

Any way of having two normal maps?  One for the diffuse, and one for the detail? 

Any way of doing some blending?  Using masks, vertex blending, or? 


RiccoChicco

.shd files are in textures folder before export but you don't need them once your scene has been exported (the shader data is "boxed" in the .edf/.map).

More informations on how to do a .shd file :

http://docs.piboso.com/wiki/index.php/Track_Creation_Rules#Shaders

Hawk

Quote from: RiccoChicco on May 04, 2015, 11:35:41 pm
.shd files are in textures folder before export but you don't need them once your scene has been exported (the shader data is "boxed" in the .edf/.map).

More informations on how to do a .shd file :

http://docs.piboso.com/wiki/index.php/Track_Creation_Rules#Shaders


So the exporter totally ignores any normal/spec  maps applied in the Maya or 3ds Max? If so then that is very poor.

Hawk.

RiccoChicco

May 04, 2015, 11:54:19 pm #3 Last Edit: May 04, 2015, 11:56:57 pm by RiccoChicco
I don't want to tell wrong things, but for me the exporter only reads the name of the diffuse map of each object, look for the matching shd file and look inside all paramaters (maps for example).

To give you an example about the fact that materials parameters are not used by the exporter, if you want to tile a texture for a track, adjusting the tiling parameter directly into the material menu will not affect the final exported scene. You have to use functions such as Xform.

But again, I'm not 100% about all that things. I'm not an expert for tracks and shaders with bikes don't work  at 100% the same  ;D

pleclair

So basically that means that each time I change a shader value, I must re-export the whole scene .map file everytime?

If Piboso is to keep this .shd definition, then at least, taking them out of the map file, putting it in one xml file, would make a lot more sense to me. 

Cause I can't see modders that need to learn the proper values to use for spec, etc, having to export the whole scene to change the road spec value.  That is not very efficient.

The only way to get a good looking grass or road, is by using a diffuse+detail textures. If you use detail quality diffuse and tile that, you will get some nasty textures in the distance, as a detail map fades away after a certain distance, so you only see it close to you... and it is much easier on the resources as well, since for the most part, it is a low res diffuse like 512x512 that is used instead of a 2k texture)... so I would really like to know how its handled in this sim, does it support multiple uv channels?  Or does it do a planar mapping ala AC for the detail maps, and adjust the tiling value.


pleclair

Quote from: Hawk UK on May 04, 2015, 11:44:03 pm
Quote from: RiccoChicco on May 04, 2015, 11:35:41 pm
.shd files are in textures folder before export but you don't need them once your scene has been exported (the shader data is "boxed" in the .edf/.map).

More informations on how to do a .shd file :

http://docs.piboso.com/wiki/index.php/Track_Creation_Rules#Shaders


So the exporter totally ignores any normal/spec  maps applied in the Maya or 3ds Max? If so then that is very poor.

Hawk.


It would be nice if the exporter carried these definitions over to the proper shd file.. or as I mentioned, and as AC does, put the mats inside an xml file... much easier to work with, all of the mats are inside 1 file...  You can do some easy search and replace too.


pleclair

It pains me to see this thread still unanswered after all these days...  I tried my best to come in here with a positive attitude, given the fact that it clearly doesn't look good from a new customer standpoint.

pCars is out now, and it turns out a lot better than I would have ever hoped.  It is actually a simulator, and a very nice one indeed.  In a month from now, we'll be in the process of moving to a new place, so we'll be in a lot of turmoils, and I won't be able to do much, regarding working on tracks and conversions. 

If this thread would have been answered, I would have put pCars on hold, and continued my learning process here with WRS until the move happens.

So, I'll wish you guys the best, I'm out to play pCars for a while.  I'll drop back when I'm ready to resume, and see if things have improved/changed.  I would appreciate if this thread was answered when I drop back, I could start work right away. 

Sincerely disappointed.

PS:  I will still finish the textures upload, feel free to use them.  I put it on hold since the uploading make pCars choppy at times.  I'll try to do it at night.

HornetMaX

Hmm ... where did the "with indie you're always in good hands" attitude go ? :)

MaX.

dibu

Sorry to see you disapointed here, pleclair.  :(

When I was reading your posts I had so much hope that your help will be a small revolution for the PiBoSo sims, especitally WRS. Please don't give up, we need friendly and skilled guys like you. :)
(Hmm, I'm not unselfish, I hope to see a good Nordschleife one day at WRS, GPB and KRP. ;) )

I'm not a modder but if I can help in any way let me know. I think I know at least a little bit about .rdf files, dedicated servers and the PiBoSo sims in general.

RiccoChicco

Same here. Pleclair is a great modder (I knew him with rF2) and that would be very bad to lose such a talented modder. Maybe he could really help to make some advertisement for WRS with his tracks.

PiBoSo

Quote from: pleclair on May 04, 2015, 11:02:47 pm
So I'm grasping a bit how it works... if I understood properly, I must create a .shd file named as my diffuse texture, and it must be in the same directory.  But... where is that?  I mean, the textures are in the .map file, right?  So, do I really need to export the map file from Max everytime I want to change a shader?  Cause figuring out how it works and how to get the results I want, I will have to make many tries, and this whole workflow seems very unproductive.. so I doubt it is the way it works. 

I'm looking at victoria, and I cannot find any shd file, so they must be as I think in the map file.  Any way to crack open a map file?  I could look at the shd of victoria and pick it up very quickly.

So basically, it woud be really nice if piboso could details everything that can go into the shd file. 

I mean, from the simple example in that thread, to the track creation rules... I see no way of doing some basic detail mapping..  having a low res diffuse + an high res detail on a different uv channel + normal + spec. 

Any way of having two normal maps?  One for the diffuse, and one for the detail? 

Any way of doing some blending?  Using masks, vertex blending, or?


Unfortunately it is needed to re-export the MAP file when a shader is changed.
Shaders info and examples: http://docs.piboso.com/wiki/index.php/Track_Creation_Rules#Shaders
Information about detail mapping: http://docs.piboso.com/wiki/index.php/Track_Creation_Rules#Textures
It's not possible to mix two normal maps.
"Obviously your ambition outweighs your talent".

PiBoSo

May 08, 2015, 07:56:46 pm #11 Last Edit: May 08, 2015, 08:01:34 pm by PiBoSo
Quote from: pleclair on May 08, 2015, 02:03:03 pm
It pains me to see this thread still unanswered after all these days...  I tried my best to come in here with a positive attitude, given the fact that it clearly doesn't look good from a new customer standpoint.

pCars is out now, and it turns out a lot better than I would have ever hoped.  It is actually a simulator, and a very nice one indeed.  In a month from now, we'll be in the process of moving to a new place, so we'll be in a lot of turmoils, and I won't be able to do much, regarding working on tracks and conversions. 

If this thread would have been answered, I would have put pCars on hold, and continued my learning process here with WRS until the move happens.

So, I'll wish you guys the best, I'm out to play pCars for a while.  I'll drop back when I'm ready to resume, and see if things have improved/changed.  I would appreciate if this thread was answered when I drop back, I could start work right away. 

Sincerely disappointed.

PS:  I will still finish the textures upload, feel free to use them.  I put it on hold since the uploading make pCars choppy at times.  I'll try to do it at night.


As expected. Usually newcomers with too much enthusiasm quickly end up rage quitting.
The workflow to create contents for GPB / WRS / KRP is different from others engines. This makes direct conversions impossible.
Of course suggestions to improve the tools and engine are always welcome, but patience and perseverance are key.
Example models will be released in the future.
"Obviously your ambition outweighs your talent".