⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sky.fx

📁 java实现的简单的分形树。简单易学!是学习分形知识的很好的例子。其java语法简单
💻 FX
字号:

// Skydome rendering.
//
// Outputs color into RT0, nothing into RT1.
// We don't want to edge-detect or hatch the skydome, hence nothing into RT1,
// RT1 gets cleared in code to max Z and normal that coincides with light.
// Sky is affected by atmospheric in-scattering only.
//
// Versions: vs1.1, ps1.1

#include "_shared.fx"
#include "_library.fx"

// --------------------------------------------------------------------------
//  vertex shader

struct VS_OUTPUT {
	float4 pos		: POSITION;
	float4 color	: COLOR0;
};

VS_OUTPUT vsMain (
	float4	pos : POSITION )
{
    VS_OUTPUT o;
	o.pos = mul( pos, mViewProj );

	// scattering
	float3 extinct, inscatter;
	float3 viewDir = normalize( pos - vEye );
	float distance = mul( pos, mView ).z;
	gScattering(
		distance, viewDir, vLightDir,
		vScatterBetaR, vScatterBetaM, vScatterBetaSum, vScatterBetaR_, vScatterBetaM_,
		vScatterSunColorDivBetaSum, vScatterHGg,
		extinct, inscatter
	);
	o.color = float4( inscatter * fScatterInscatMult, 1 );
	return o;
}

// --------------------------------------------------------------------------
//  pixel shader

struct PS_INPUT {
	float4 color : COLOR0;
};

float4 psMain( PS_INPUT i ) : COLOR
{
	return i.color;
}

// --------------------------------------------------------------------------
//  effect

technique tec0 {
	pass P0 {
		VertexShader = compile vs_1_1 vsMain();
		PixelShader = compile ps_1_1 psMain();
	}
	pass PLast {
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -