Board index FlightGear Development Aircraft Cockpit development

Interior shadow effect erases textures

Discussion about creating 2d and 3d cockpits.

Interior shadow effect erases textures

Postby Kikokou-san » Tue Nov 07, 2017 7:32 pm

Hi all,

I'm currently working on adding internal shadows into the new A32X from It0uchPod Design Group.

I've created a cubemap with correct faces and orientation (I guess actually as there is not many ways to check it), and the problem I have is that all the models that I had to the effect lose their original texture.

The shadows are more or less working on these objects, but they have no texture anymore.

Please see below :

Image
Image
Image
Image
Image


Any idea of how to solve this ?

Another question by the way : I understood that the center of the cube map has to be specified to correspond roughly to the coordinated where the camera was when rendering the 6 faces of the cube, however it is more difficult for me to understand the scale criteria. How can we know the "size" of the cube, and then compute the scale factors for the cube to encompass the cockpit ?

Thank you !!
Kikokou-san
 
Posts: 26
Joined: Wed Mar 15, 2017 10:55 am

Re: Interior shadow effect erases textures

Postby Thorsten » Tue Nov 07, 2017 7:36 pm

Any idea of how to solve this ?


It's almost certainly an error you've made in defining the effect, but it's hard to guess what it might be.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Interior shadow effect erases textures

Postby Kikokou-san » Tue Nov 07, 2017 7:42 pm

Actually, I created a new effect file named IDG-A32X-interior.eff with the following code :

Code: Select all
<?xml version="1.0" encoding="utf-8"?>

<PropertyList>
  <name>IDG-A32X-interior-glass</name>
  <inherits-from>Effects/model-interior</inherits-from>
  <parameters>
    <texture n="4">
      <type>cubemap</type>
      <images>
         <positive-x>0004.png</positive-x>
         <negative-x>0002.png</negative-x>
         <positive-y>0001.png</positive-y>
         <negative-y>0003.png</negative-y>
         <positive-z>0005.png</positive-z>
         <negative-z>0006.png</negative-z>
      </images>
    </texture>
    <opacity-cube-center type="vec3d" n="0"> 0.6 0.0 0.7</opacity-cube-center>
    <opacity-cube-scale type="vec3d" n="0"> 1 2 1</opacity-cube-scale>
    <opacity-cube-angle type="float">0.0</opacity-cube-angle>
  </parameters>
</PropertyList>


After this I included the following lines at the end of the a320.flightdeck.xml file, just before the closing PropertyList tag :

Code: Select all
<effect>
         <inherits-from>Effects/IDG-A32X-interior</inherits-from>
          <object-name>fcu_panel</object-name>
         <object-name>main_panel</object-name>
         <object-name>ped_labels_1</object-name>
         <object-name>ped_labels_2</object-name>
         <object-name>carpet</object-name>
         <object-name>so.1</object-name>
         <object-name>sts.002</object-name>
         <object-name>Seat</object-name>
         <object-name>beam_a</object-name>
         <object-name>beam_f</object-name>
   </effect>


The files of my cubemap are in the same folder that a320.flightdeck.xml file..
Kikokou-san
 
Posts: 26
Joined: Wed Mar 15, 2017 10:55 am

Re: Interior shadow effect erases textures

Postby wlbragg » Tue Nov 07, 2017 7:58 pm

Is this the only effect file being applied to these objects?

I use the following path to my effects on the Aircrane
Models/Effects/interior/cockpit-interior
on the c172p we use
Effects/interior/c172p-interior

I have had problems getting the paths to work as I expect in the past. Not sure if it was the location of the origination folder of the file calling the effect or what. Be sure to check the paths carefully.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7609
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Interior shadow effect erases textures

Postby Kikokou-san » Tue Nov 07, 2017 8:34 pm

Thank you ! :)

I found the solution with your help !

It was indeed a path issue...

I read the file dozens of times but missed the error in the path : I had to add "Models" before "Effects". The folder organisation was indeed different from the C172 one..

Regarding the scale factor, can I ask how you can compute it ?
Kikokou-san
 
Posts: 26
Joined: Wed Mar 15, 2017 10:55 am

Re: Interior shadow effect erases textures

Postby Thorsten » Wed Nov 08, 2017 7:27 am

@Wayne: Good catch with the paths - my next suspicion would have been a different effect applied to the same surfaces...

@ Kikokou-san: Basically you imagine that the flightdeck is approximated by a cube and use the dimensions of that cube. The details aren't terribly important, because for each surface what counts how far the opposite surface is away. For the kind of cockpit you're looking at, it's perhaps 4 meters across the cube or so.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am


Return to Cockpit development

Who is online

Users browsing this forum: No registered users and 2 guests