Board index FlightGear Development Effects and shaders

Bump map / normal map question

An exciting "new" option in FlightGear, that includes reflections, lightmaps, the particle system etc.. A lot is yet to be discovered/implemented!

Bump map / normal map question

Postby N-SCOT » Mon Nov 14, 2011 4:41 pm

Hey all,

Might be a stupid Q, but need to know. I am working on bump map texturizing the Canberra BI8 model. ! want seams (depth) and rivets (height). To this end I created 2 bumpmaps for this. I put the references for the effects into the model xml, but only the first texture is shown.

So...

Should I a) use the model xml to call textures using two .eff files, or use one .eff file to describe the 2 textures? ; or b) can I generate a bumpmap with BOTH height and depth from the "base"?

The code I have is as follows:
Code: Select all

2 .eff files, named eec_bumpspec_rivets & eec_bumpspec_seams

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<!-- Bump and specular effect-->

<PropertyList>
  <name>Aircraft/CanberraBI8/Models/Effects/eec_bumpspec_seams</name>
  <inherits-from>Effects/bumpspec</inherits-from>
  <parameters>
    <texture n="2">
      <image>Aircraft/CanberraBI8/Models/Liveries/seams_bump.png</image>
      <filter>linear-mipmap-linear</filter>
      <wrap-s>repeat</wrap-s>
      <wrap-t>repeat</wrap-t>
      <internal-format>normalized</internal-format>
    </texture>
  </parameters>
</PropertyList>


Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<!-- Bump and specular effect-->

<PropertyList>
  <name>Aircraft/CanberraBI8/Models/Effects/eec_bumpspec_rivets</name>
  <inherits-from>Effects/bumpspec</inherits-from>
  <parameters>
    <texture n="3">
      <image>Aircraft/CanberraBI8/Models/Liveries/rivets_bump.png</image>
      <filter>linear-mipmap-linear</filter>
      <wrap-s>repeat</wrap-s>
      <wrap-t>repeat</wrap-t>
      <internal-format>normalized</internal-format>
    </texture>
  </parameters>
</PropertyList>


I also tried (without success)
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<!-- Bump and specular effect-->

<PropertyList>
  <name>Aircraft/CanberraBI8/Models/Effects/eec_bumpspec</name>
  <inherits-from>Effects/bumpspec</inherits-from>
  <parameters>
    <texture n="2">
      <image>Aircraft/CanberraBI8/Models/Liveries/seams_bump.png</image>
      <filter>linear-mipmap-linear</filter>
      <wrap-s>repeat</wrap-s>
      <wrap-t>repeat</wrap-t>
      <internal-format>normalized</internal-format>
    </texture>
    <texture n="3">
      <image>Aircraft/CanberraBI8/Models/Liveries/rivets_bump.png</image>
      <filter>linear-mipmap-linear</filter>
      <wrap-s>repeat</wrap-s>
      <wrap-t>repeat</wrap-t>
      <internal-format>normalized</internal-format>
    </texture>
  </parameters>
</PropertyList>


with the n="" being set up as shown or both values being "2".

My relevant model xml code is as follows:
Code: Select all
 
  <!-- Bump Map Effect -->
 <effect>
    <inherits-from>Aircraft/CanberraBI8/Models/Effects/eec_bumpspec_seams</inherits-from>
    <object-name>Low-Rez-Body</object-name>
    <object-name>FUS-Hull</object-name>
    <object-name>CP-R-Frame-Inside</object-name>
    <object-name>CP-F-Canopy-Frame</object-name>
    <object-name>WNG-L</object-name>
    <object-name>WNG-R</object-name>
    <object-name>WNG-R-Aileron</object-name>
    <object-name>WNG-L-Aileron</object-name>
    <object-name>WNG-F-Tip-Tank</object-name>
    <object-name>WNG-R-Tip-Tank</object-name>
    <object-name>ENG-L-Nacelle</object-name>
    <object-name>ENG-R-Nacelle</object-name>
    <object-name>EMP-Tail-Plane</object-name>
    <object-name>EMP-L-Elev</object-name>
    <object-name>EMP-R-Elev</object-name>
    <object-name>EMP-Fin</object-name>
    <object-name>EMP-Rudder</object-name>
    <object-name>UC-L-Door</object-name>
    <object-name>UC-LI-Door-Outside</object-name>
    <object-name>UC-RI-Door-Outside</object-name>
    <object-name>UC-R-Door</object-name>
    <object-name>WNG-R-Inner-Flap</object-name>
    <object-name>WNG-L-Inner-Flap</object-name>
    <object-name>WNG-R-Outer-Flap</object-name>
    <object-name>WNG-L-Outer-Flap</object-name>
    <object-name>FUS-LO-Bomb-Door</object-name>
    <object-name>FUS-RO-Bomb-Door</object-name>
    <object-name>UC-RF-Door.002</object-name>
    <object-name>UC-RF-Door.001</object-name>
   <object-name>FUS-Hatch-Outside</object-name>
 </effect>

 <effect>
    <inherits-from>Aircraft/CanberraBI8/Models/Effects/eec_bumpspec_rivets</inherits-from>
    <object-name>Low-Rez-Body</object-name>
    <object-name>FUS-Hull</object-name>
    <object-name>CP-R-Frame-Inside</object-name>
    <object-name>CP-F-Canopy-Frame</object-name>
    <object-name>WNG-L</object-name>
    <object-name>WNG-R</object-name>
    <object-name>WNG-R-Aileron</object-name>
    <object-name>WNG-L-Aileron</object-name>
    <object-name>WNG-F-Tip-Tank</object-name>
    <object-name>WNG-R-Tip-Tank</object-name>
    <object-name>ENG-L-Nacelle</object-name>
    <object-name>ENG-R-Nacelle</object-name>
    <object-name>EMP-Tail-Plane</object-name>
    <object-name>EMP-L-Elev</object-name>
    <object-name>EMP-R-Elev</object-name>
    <object-name>EMP-Fin</object-name>
    <object-name>EMP-Rudder</object-name>
    <object-name>UC-L-Door</object-name>
    <object-name>UC-LI-Door-Outside</object-name>
    <object-name>UC-RI-Door-Outside</object-name>
    <object-name>UC-R-Door</object-name>
    <object-name>WNG-R-Inner-Flap</object-name>
    <object-name>WNG-L-Inner-Flap</object-name>
    <object-name>WNG-R-Outer-Flap</object-name>
    <object-name>WNG-L-Outer-Flap</object-name>
    <object-name>FUS-LO-Bomb-Door</object-name>
    <object-name>FUS-RO-Bomb-Door</object-name>
    <object-name>UC-RF-Door.002</object-name>
    <object-name>UC-RF-Door.001</object-name>
   <object-name>FUS-Hatch-Outside</object-name>
 </effect> 


Long and the short - can I only have 1 texture, or more? Then, if so, how?

:D

Gary aka N-SCOT
Gary Brown, aka N-SCOT
Favorite Aircraft: Military
Favorite FG activity: Livery generation
N-SCOT
 
Posts: 178
Joined: Sun Apr 19, 2009 3:17 pm
Location: Gainesville, Florida. Home of the "Fighting' Gators"!
Callsign: N-SCOT
Version: 2020.1.2
OS: OSX High Sierra

Re: Bump map / normal map question

Postby Tuxklok » Mon Nov 14, 2011 4:59 pm

You don't need two normal map textures, just one will do the job fine.

cheers
The Austria Scenery Project - more info
fg-scenery-tools - gitorious | videos
fgcomgui - Open source, cross platform, gui front end for fgcom. more info

More random musings and doings can be found on my personal site. (work in progress)
User avatar
Tuxklok
 
Posts: 1320
Joined: Tue Apr 21, 2009 7:04 pm
Location: Orlando, FL
Callsign: Tuxklok / N1292P
OS: GNU/Linux

Re: Bump map / normal map question

Postby i4dnf » Mon Nov 14, 2011 5:01 pm

HI,
You can have only one bump texture (normalmap), and you can generate one containing both raised parts and lowered.
If you're using the gimp plugin, make sure you start off with a gray background (128, 128, 128), and then for lowered parts use darker shades, for raised parts use lighter shades.
i4dnf
Retired
 
Posts: 743
Joined: Wed Sep 09, 2009 8:17 am
Location: LRBS
Callsign: YR-I4D
Version: GIT
OS: Gentoo Linux ~amd64

Re: Bump map / normal map question

Postby N-SCOT » Tue Nov 15, 2011 5:14 pm

Rockin. While I can't find a suitable Gimp plugin for the mac, I got CrazyBump and this does the job nicely. Thanks for helpin' a noob!

LOL

Gary
Gary Brown, aka N-SCOT
Favorite Aircraft: Military
Favorite FG activity: Livery generation
N-SCOT
 
Posts: 178
Joined: Sun Apr 19, 2009 3:17 pm
Location: Gainesville, Florida. Home of the "Fighting' Gators"!
Callsign: N-SCOT
Version: 2020.1.2
OS: OSX High Sierra

Re: Bump map / normal map question

Postby N-SCOT » Fri Sep 28, 2012 3:09 pm

ooh....long time since I've been in this thread, but still apt for my next Q....

:D

So, since this post started, I've become (I hope) more adept at bumpmapping aircraft along with liv development. As 2.8 ushers in big changes for this sort of thing, I wonder if some demigod or guru from FG community could develop a tutorial on duplicating this effect in 2.8 / Rembrandt?

I believe that the B1900 would be an excellent example, and would be happy to a) learn what to do, and b) assist in putting a tutorial together.

So, any takers?

Gary
Gary Brown, aka N-SCOT
Favorite Aircraft: Military
Favorite FG activity: Livery generation
N-SCOT
 
Posts: 178
Joined: Sun Apr 19, 2009 3:17 pm
Location: Gainesville, Florida. Home of the "Fighting' Gators"!
Callsign: N-SCOT
Version: 2020.1.2
OS: OSX High Sierra


Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 8 guests