User talk:Necolatis

From FlightGear wiki
Jump to navigation Jump to search

Model-combined shader issues

Hi, I've noticed that you've posted on the forums some issue with the model-combined* effects. Could you tell/show me what the desired effect was, what was the transparency setting for the glass material (in the .ac file)? (I'm the main author of those shaders)

The shader used is the same between the effects, the difference is how they are assigned to the various render-bins and the transparency hint, so that you don't get weird culling issues with objects behind the transparent ones, and so that it's properly handled by Rembrandt.

Using the non transparent variant will cause various issues across the board. (dissapearing bits of models behind the glass object, rainbow model in rembrandt, etc. )

I4dnf (talk) 09:23, 19 May 2014 (UTC)


Sure. First off, I did not test the transparency in Rembrandt yet. But it looks to work in normal and ALS.

I am not entirely satisfied yet, but getting this to work was a big step.

I have not discovered any issues with using it this way yet, but I did take the renderbin from the transparency effect, forgot to mention that in the forum-post.

MATERIAL "glassMat" rgb 0.8000 0.8000 0.8000 amb 0.0 0.0 0.0 emis 0.0000 0.0000 0.0000 spec 1.0000 1.0000 1.0000 shi 128 trans 0.5000

<PropertyList>

<name>Effects/ja37-glass-combined</name>
<inherits-from>Effects/model-combined-deferred</inherits-from>
<parameters>
  <normalmap-enabled type="int">0</normalmap-enabled>
  <reflection-enabled type="int">1</reflection-enabled>
  <reflection-correction type="float">-0.5</reflection-correction>
  <reflection-fresnel type="float">0</reflection-fresnel>
  <reflection-rainbow type="float">0.5</reflection-rainbow>
  <reflection-noise type="float">0.0</reflection-noise>
  <shade-model>smooth</shade-model>
  <texture n="2">
    <image>Aircraft/JA37/Models/Effects/ja37-glass-specular.png</image>
    <filter>linear</filter>
    <wrap-s>repeat</wrap-s>
    <wrap-t>repeat</wrap-t>
    <internal-format>normalized</internal-format>
  </texture>
  <texture n="5">
    <type>cubemap</type>
    <images>
      <positive-x>Aircraft/JA37/Models/Effects/ja37-glass-reflect.png</positive-x>
      <negative-x>Aircraft/JA37/Models/Effects/ja37-glass-reflect.png</negative-x>
      <positive-y>Aircraft/JA37/Models/Effects/ja37-glass-reflect.png</positive-y>
      <negative-y>Aircraft/JA37/Models/Effects/ja37-glass-reflect.png</negative-y>
      <positive-z>Aircraft/JA37/Models/Effects/ja37-glass-reflect.png</positive-z>
      <negative-z>Aircraft/JA37/Models/Effects/ja37-glass-reflect.png</negative-z>
    </images>
  </texture>
  <texture n="7">
    <image>Aircraft/Generic/Effects/Rainbow.png</image>
    <filter>linear-mipmap-linear</filter>
    <wrap-s>repeat</wrap-s>
    <wrap-t>repeat</wrap-t>
    <internal-format>normalized</internal-format>
  </texture>
     <rendering-hint>transparent</rendering-hint>
     <transparent>true</transparent>
     <render-bin>
       <bin-number>10</bin-number>
       <bin-name>DepthSortedBin</bin-name>
     </render-bin>
</parameters>

</PropertyList>

Necolatis (talk) 11:09, 19 May 2014 (UTC)