public static void SetCameraFromSTPRM(ParamFile stprm) { if (stprm != null) { float fov = (float)RenderTools.GetValueFromParamFile(stprm, 0, 0, 6); Runtime.fov = fov * ((float)Math.PI / 180.0f); Runtime.renderDepth = (float)RenderTools.GetValueFromParamFile(stprm, 0, 0, 77); } }
private static Vector3 CreateFogColorFromFogSet(ParamFile lightSet, int i) { float hue = (float)RenderTools.GetValueFromParamFile(lightSet, 2, 1 + i, 0); float saturation = (float)RenderTools.GetValueFromParamFile(lightSet, 2, 1 + i, 1); float value = (float)RenderTools.GetValueFromParamFile(lightSet, 2, 1 + i, 2); float fogR = 0.0f, fogB = 0.0f, fogG = 0.0f; ColorTools.HSV2RGB(hue, saturation, value, out fogR, out fogG, out fogB); Vector3 color = new Vector3(fogR, fogG, fogB); return(color); }
private static DirectionalLight CreateDirectionalLightFromLightSet(ParamFile lightSet, int lightNumber, string name) { bool enabled = (uint)RenderTools.GetValueFromParamFile(lightSet, 1, lightNumber, 1) == 1; float hue = (float)RenderTools.GetValueFromParamFile(lightSet, 1, lightNumber, 2); float saturation = (float)RenderTools.GetValueFromParamFile(lightSet, 1, lightNumber, 3); float value = (float)RenderTools.GetValueFromParamFile(lightSet, 1, lightNumber, 4); float rotX = (float)RenderTools.GetValueFromParamFile(lightSet, 1, lightNumber, 5); float rotY = (float)RenderTools.GetValueFromParamFile(lightSet, 1, lightNumber, 6); float rotZ = (float)RenderTools.GetValueFromParamFile(lightSet, 1, lightNumber, 7); DirectionalLight newLight = new DirectionalLight(hue, saturation, value, 0, 0, 0, rotX, rotY, rotZ, name); newLight.enabled = enabled; // doesn't render properly for some stages return(newLight); }
public static void SetLightsFromLightSetParam(ParamFile lightSet) { if (lightSet != null) { // stage diffuse for (int i = 0; i < stageDiffuseLightSet.Length; i++) { stageDiffuseLightSet[i] = CreateDirectionalLightFromLightSet(lightSet, 4 + i, "Stage " + i); } // stage fog for (int i = 0; i < stageFogSet.Length; i++) { stageFogSet[i] = CreateFogColorFromFogSet(lightSet, i); } // character diffuse { float difHue = (float)RenderTools.GetValueFromParamFile(lightSet, 0, 0, 29); float difSaturation = (float)RenderTools.GetValueFromParamFile(lightSet, 0, 0, 30); float difIntensity = (float)RenderTools.GetValueFromParamFile(lightSet, 0, 0, 31); float ambHue = (float)RenderTools.GetValueFromParamFile(lightSet, 0, 0, 33); float ambSaturation = (float)RenderTools.GetValueFromParamFile(lightSet, 0, 0, 34); float ambIntensity = (float)RenderTools.GetValueFromParamFile(lightSet, 0, 0, 35); float rotX = (float)RenderTools.GetValueFromParamFile(lightSet, 1, 4, 5); float rotY = (float)RenderTools.GetValueFromParamFile(lightSet, 1, 4, 6); float rotZ = (float)RenderTools.GetValueFromParamFile(lightSet, 1, 4, 7); diffuseLight = new DirectionalLight(difHue, difSaturation, difIntensity, ambHue, ambSaturation, ambIntensity, 0, 0, 0, "Diffuse"); } // character diffuse 2 { diffuseLight2 = CreateDirectionalLightFromLightSet(lightSet, 0, "Diffuse2"); } // character diffuse 3 { diffuseLight3 = CreateDirectionalLightFromLightSet(lightSet, 1, "Diffuse3"); } // fresnel lighting { float hueSky = (float)RenderTools.GetValueFromParamFile(lightSet, 0, 0, 8); float satSky = (float)RenderTools.GetValueFromParamFile(lightSet, 0, 0, 9); float intensitySky = (float)RenderTools.GetValueFromParamFile(lightSet, 0, 0, 10); float hueGround = (float)RenderTools.GetValueFromParamFile(lightSet, 0, 0, 11); float satGround = (float)RenderTools.GetValueFromParamFile(lightSet, 0, 0, 12); float intensityGround = (float)RenderTools.GetValueFromParamFile(lightSet, 0, 0, 13); float skyAngle = (float)RenderTools.GetValueFromParamFile(lightSet, 0, 0, 14); float groundAngle = (float)RenderTools.GetValueFromParamFile(lightSet, 0, 0, 15); fresnelLight = new HemisphereFresnel(hueGround, satGround, intensityGround, hueSky, satSky, intensitySky, skyAngle, groundAngle, "Fresnel"); } } }