Anyone know how to make a reflective gauge lens like the one on the msm125?
Thanks
shaders?
Tried shaders and it did not work but i think i may just have stumbled onto something to try by accident linked to the way objects and textures are defined in the model file.
Need to rebuild my test model first though
No, did no work :( I think there must be something special about transparency that i am not understanding
Have you seen this?
http://docs.piboso.com/wiki/index.php/Track_Creation_Rules#Shaders (http://docs.piboso.com/wiki/index.php/Track_Creation_Rules#Shaders)
You could start with a simple box to understand what does what.
For transparency, apply a texture with an alpha channel with 'black = completely transparent' and 'white = completely opaque' (and with the color channel defining the color of the glass).
Thanks for the link,
I think i follow the cube mapping idea and i will give it a go.
At the moment i gave a transparent layer but it just seems to be completely transparent and changing between white and black just seems to effect the opacity of the gauge legend behind the lens, the lens itself does not seems to have any 'volume' or reflection.
So if i understand this correctly, if my gauge lens is an object within the model a transparent texture applied, then for that that texture i can create a shader (.shd) referencing the environment cube map(s) that are then applied when converting using fbx2edf.
So for my simple object gauge lens model i should just be able to get started by creating the 6 cube face maps with the level between black and white being the reflection level that my gauge lens will display in game.
I probably have this all wrong though ;)
It makes me think that a "layer" of transparent/reflective could be nice to have on the digital displays (dash) of the more modern bikes.
Out of memory, they haven't it and the dash looks flat.
It seems mixed, the msm125 and 500 have a nice reflection but strangely the 990 and many MOD bikes do not.
I am hoping the generic flat cube texture works OK, i remember that GP500 had a similar generic texture that was used for all reflection so i might see if i have a copy of that somewhere to use.
The full rendering method is explained here https://en.wikipedia.org/wiki/Cube_mapping (https://en.wikipedia.org/wiki/Cube_mapping) for anyone wondering what i am waffling on about ;)
Quote from: h106frp on February 26, 2016, 11:23:27 AM
It seems mixed, the msm125 and 500 have a nice reflection but strangely the 990 and many MOD bikes do not.
Probably because on a digital dash if you don't do it it doesn't look that bad (on analogue dash if you don't do it it looks plain horrible).
But still, if one does it on a digital dash, it should look better :)
Think i have found the environment cube map in the effect.pkz file :)
The top view looks like it could possibly be for an analog gauge
Still no good >:( starting to think this is all too difficult.
Does anyone know if fbx2edf (standalone) displays a log message when applying the shader? i am not even sure if it is processing the shader script. I would have expected at least a non compiled model or bizarre visual effects in game with all the variants i have tried.
As much as I understand it cube map is the wrong choice for a bike. The map is always the same and when moving around it doesn't change?
Maybe you see it too complicated. As I already suggested you could start with a box.
Unwrap that box (in Edit Mode select all and hit U and Unwrap).
Create a texture with an alpha channel (alpha channel with something between black and white) and apply it to the box - if you are exporting with "FBX 6.1 ASCII" than you have to apply it in the UV/Image Editor, for "FBX 7.4 binary" you have to use Blenders Material/Texture.
Now if you export this box (as .edf and a part of the bike for example) it should be more or less transparent.
The alpha channel needs to be in the texture. Don't use Blenders transparency options.
I can't remember any messages in the fbx2edf converter concerning the shaders. But the size of the resulting file should differ.
I don't know what you did with Blender already and what not, so if you need a more detailed description about something, just ask and I'll try to tell you what I know.
I think since you got this far with your model, shaders shouldn't be the problem.
Even though you can apply all this to your model in your 3D app(Blender in your case), as far as I know the FBX2EDF exporter won't export it all. You have to set it up all again through the Shader text file(.shd)? Crazy I know, but that's the way I see it. ::) >:(
This is why I've been trying to convince Piboso to allow the FBX2EDF exporter to export everything we apply in our 3D apps, but he doesn't seem to see the point. ::)
Hawk.
Completely lost now, from what i read on the PB wiki the CUBE model shader file is the only way to create a reflection map. Looking at the packed env file the .tga images appear to just be the reflection level maps and guessed that this is then used to compute a real time reflection somehow.
The thing that is puzzling me is that the shader script doe not appear to be doing anything at all to the object appearance in game - so i guess i am doing something more fundamentally wrong in using fbx2edf.
Only use
reflection
{
factormin = 0
factormax = 0.9
factorexp = 1.2
}
for example.
Just leave "envmap = env.tga" away.
What you can add later is the "map = reflection_map.tga" that defines what reflects how much.
Edit:
Something I forgot: It looks like you always need specular as well for the reflection to work.
So for example:
specular
{
shininess = 6
}
reflection
{
factormin = 0
factormax = 0.9
factorexp = 1.2
}
Starting to think its something to do with the way that blender/fbx file handles material. Managed to get it shiny lenses once by accident but could not repeat the effect on purpose :(
It seems that fbx2edf uses the materials that must be packed in the fbx file but beyond that still guessing.
Do not want to continue texturing the model until i properly understand whats going on with the shaders as i guess i will have the same problems with the other textured areas.
Oh well, back to trial and error.
It works as Hawk said..
Quote from: h106frp on February 27, 2016, 06:24:54 PM
Starting to think its something to do with the way that blender/fbx file handles material. Managed to get it shiny lenses once by accident but could not repeat the effect on purpose :(
Just as a test - Try deleting all your construction history before you export from blender to .fbx, but make a backup copy of your work first before you delete the construction history.
I've had strange things happening with my textures not rendering properly in GPB when I've exported from Maya to .fbx without deleting my construction history first before using the FBX2EDF Exporter, but when I deleted my construction history everything rendered as it should - Not sure whether to report that as a bug yet because I'm still not sure what was causing the rendering issues. :-\
Hawk.
Finally worked something out something,
I was moving the export fbx file to another folder with the fbx2edf converter in it and the shader files were in the same folder.
After having the thought of reading through an ascii fbx i noticed that all the textures are referenced to the original folder i used to load them into blender. ::)
So moving the shader files to the original folder (but still running fbx2edf in another folder) and hey presto i have shininess in game so at least i know how that bit works now. Would have realised hours earlier if the fbx2edf had some log output for shader processing.
Still do not have the reflection model but at least i know how to get shader processing working now so a bit more confident on texturing
the rest of the model.
Did it :) Looks very cool with reflection and shininess - much more convincing, just need to work on the maps and effect balance but i can leave that for later now.
Quote from: h106frp on February 27, 2016, 11:18:56 PM
Finally worked something out something,
I was moving the export fbx file to another folder with the fbx2edf converter in it and the shader files were in the same folder.
After having the thought of reading through an ascii fbx i noticed that all the textures are referenced to the original folder i used to load them into blender. ::)
So moving the shader files to the original folder (but still running fbx2edf in another folder) and hey presto i have shininess in game so at least i know how that bit works now. Would have realised hours earlier if the fbx2edf had some log output for shader processing.
Still do not have the reflection model but at least i know how to get shader processing working now so a bit more confident on texturing
the rest of the model.
Did it :) Looks very cool with reflection and shininess - much more convincing, just need to work on the maps and effect balance but i can leave that for later now.
So you did all that through exporting via the FBX2EDF Exporter? You didn't have to create shader.shd text files?
Hawk.
No, still need the shader files, the problem was directory referencing - the shader files needed to be in the same folder as the original texture files that i imported into blender even though i could run fbx2edf from a different folder containing the fbx model file.
I wrongly assumed the shader files needed to be in the same folder as fbx2edf but all textures reference to their original folder.
Need to experiment a bit with the maps but have managed to get some accidental nice effects on the windshield - actually looks like clear acrylic :)
From PiBoSo's Track Creation Rules:
"Shaders are linked to textures. To apply a shader to a texture, create a text file with extensions SHD in the same directory and the same name of the texture file." ;)
I had all the textures, model file, shaders and fbx2edf in the same directory ;) ....
It just was not the directory i had used when i first created the model in blender and it was only looking at the ascii fbx file i realised that the texture paths are hard coded in the export file and not relative to the current file location.
I guess this makes the fbx file 'non-portable' in many ways.
Ah ok, didn't sound like that.
If you had to make it portable for some reason, change "Path Mode" to "Copy" and tick the button to the right to embed the textures into the fbx (FBX 7.4 binary and textures applied with materials only) or leave it unticked to have a new folder with the textures next to the fbx.
Quote from: h106frp on February 29, 2016, 02:07:38 PM
I had all the textures, model file, shaders and fbx2edf in the same directory ;) ....
It just was not the directory i had used when i first created the model in blender and it was only looking at the ascii fbx file i realised that the texture paths are hard coded in the export file and not relative to the current file location.
I guess this makes the fbx file 'non-portable' in many ways.
To export "media"(textures) with your fbx export you need to set your fbx export options to save as binary file not ascii. The fbx export will then generate a folder .fmb with all your textures and media inside addressed relatively to you model. The fbx format was specifically designed to be portable between most digital media applications. ;)
Hope this helps mate. :)
Hawk.
Normally i use the binary, it was only to try and problem solve that i exported an ascii.
Thanks Steven, i now understand what some of the options are for in the binary exporter.
Learn a little more each day ;)