• Welcome to PiBoSo Official Forum. Please login or sign up.
 
August 27, 2025, 07:48:54 PM

reflective gauge lens

Started by h106frp, February 25, 2016, 04:54:30 PM

Previous topic - Next topic

h106frp

Anyone know how to make a reflective gauge lens like the one on the msm125?

Thanks

JJS209


h106frp

February 25, 2016, 07:30:30 PM #2 Last Edit: February 25, 2016, 08:58:46 PM by h106frp
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



Steven

Have you seen this?
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).

h106frp

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  ;)

HornetMaX

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.

h106frp

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 for anyone wondering what i am waffling on about  ;)


HornetMaX

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 :)

h106frp

February 26, 2016, 02:02:33 PM #8 Last Edit: February 26, 2016, 05:25:53 PM by h106frp
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.




Steven

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.

Hawk

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.

h106frp

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.

Steven

February 27, 2016, 01:12:58 PM #12 Last Edit: February 27, 2016, 01:24:33 PM by Steven
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
}

h106frp

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.

TFC