• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Shader variables and expressions

Messages
172
Hi All

Getting into P3d V4.

I am trying to be clever with shader variables through PTA tool. PTA's own explanation of shader variables and expressions is a bit thin. I can not find in the SDK where the variables may be listed and explained.

Simple example from PTA
(saturate(1.0 - cb_Altitude/2438))

As PTA explain, this changes the saturation level above 2438m, but changes from what to what? Does the minus mean above or below the variable? Sometimes it is a plus symbol. Not sure how and when to use which.

Anybody know where it is hidden in the SDK learning centre, if there at all? I am assuming it's part of the P3D system, and not PTA specific.

Cheers

Graeme
 
As per the MS DX SDK HLSL documentation, the saturate function clamps the x parameter within the range of 0 to 1. The input value is 1.0 - cb_Altitude/2438 so the value of cb_Altitude is in meters. if altitude is < 2438, divide by 2438 will give you a value between 0 and 1. 1.0 - 0.6 for example will give a value of 0.4. If altitude exceeds 2438, you will get a value of > 1. Therefore 1.0 - 1.2 for example will give -0.2. A value of -0.2 passed to the saturate function will be clamped to 0.
 
Wow that's way beyond me.

I was wondering where the docs were, so they are in the DX SDK. I'll try downloading and see how I get on.

Thanks for the reply.
 
After my 15th read (and a helpful chap at AVSIM), the penny dropped. Thanks. Just downloading the docs to see about clamping a rigid value to a certain alt then having it reduce.

What a varied hobby this is.
 
Would be interested in seeing the post at avsim...link?
 
Back
Top