I still haven't given up on the idea of 'masking' the terrain pixel shading by 
the cockpit, since even a very simple mask easily makes the system 50% faster 
for me. Lauri has kindly given me some instructions on how to use the stencil 
buffer - so the idea was to start by filling the stencil buffer with a mask 
whenever there is an opaque pixel in the model.

In order to do so, I added this pass in front of the first pass declared in 
model-default.eff

<pass>
<stencil>
<function>always</function>
<value>1</value>
<pass>replace</pass>
</stencil>
<alpha-test>
<comparison>gequal</comparison>
<value type="float">0.99</value>
</alpha-test>
<depth>
<write-mask>false</write-mask>
</depth>
</pass>

What happened is that I got the near camera rendered fine, but as good pretty 
much nothing from the far camera. 

I can insert the same code before the first pass declared in 
terrain-default.eff where it doesn't have any harmful side effects, the scene 
renders just fine. So the code as such isn't defunct. It seems I can insert no 
pass whatsoever before the first pass declared in model-default.eff without 
disabling the far camera.

Which means there is something I don't understand at all. 

Is there absolute meaning to the passes, i.e. are all first passes done first, 
then the information obtained there is in the buffers and available for all 
other effects when the second passes run, or are passes only a means to 
establish relative order in the effect files? Why can't I add passes to model 
rendering, but I can to terrain, clouds or trees?

I've tried to understand what is happening in CameraGroup.cxx, but I have no 
real clue - the whole context beats me, I don't even see where near or far 
camera are defined. Some explanations perhaps?

Thanks,

* Thorsten
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to