コード例 #1
0
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
GLSLESProgram::GLSLESProgram(ResourceManager* creator,
                             const String& name, ResourceHandle handle,
                             const String& group, bool isManual, ManualResourceLoader* loader)
    : HighLevelGpuProgram(creator, name, handle, group, isManual, loader)
    , mGLShaderHandle(0)
    , mGLProgramHandle(0)
    , mCompiled(0)
#if !OGRE_NO_GLES2_GLSL_OPTIMISER
    , mIsOptimised(false)
    , mOptimiserEnabled(false)
#endif
{
    if (createParamDictionary("GLSLESProgram"))
    {
        setupBaseParamDictionary();
        ParamDictionary* dict = getParamDictionary();

        dict->addParameter(ParameterDef("preprocessor_defines",
                                        "Preprocessor defines use to compile the program.",
                                        PT_STRING),&msCmdPreprocessorDefines);
#if !OGRE_NO_GLES2_GLSL_OPTIMISER
        dict->addParameter(ParameterDef("use_optimiser",
                                        "Should the GLSL optimiser be used. Default is false.",
                                        PT_BOOL),&msCmdOptimisation);
#endif
    }
    // Manually assign language now since we use it immediately
    mSyntaxCode = "glsles";
}
コード例 #2
0
ファイル: OgreCgProgram.cpp プロジェクト: wjwwood/ogre
	//-----------------------------------------------------------------------
	CgProgram::CgProgram(ResourceManager* creator, const String& name, 
		ResourceHandle handle, const String& group, bool isManual, 
		ManualResourceLoader* loader, CGcontext context)
		: HighLevelGpuProgram(creator, name, handle, group, isManual, loader), 
		mCgContext(context), 
		mSelectedCgProfile(CG_PROFILE_UNKNOWN), mCgArguments(0), mParametersMapSizeAsBuffer(0)
	{
		if (createParamDictionary("CgProgram"))
		{
			setupBaseParamDictionary();

			ParamDictionary* dict = getParamDictionary();

			dict->addParameter(ParameterDef("entry_point", 
				"The entry point for the Cg program.",
				PT_STRING),&msCmdEntryPoint);
			dict->addParameter(ParameterDef("profiles", 
				"Space-separated list of Cg profiles supported by this profile.",
				PT_STRING),&msCmdProfiles);
			dict->addParameter(ParameterDef("compile_arguments", 
				"A string of compilation arguments to pass to the Cg compiler.",
				PT_STRING),&msCmdArgs);
		}
		
	}
コード例 #3
0
	//-----------------------------------------------------------------------
	D3D10HLSLProgram::D3D10HLSLProgram(ResourceManager* creator, const String& name, 
		ResourceHandle handle, const String& group, bool isManual, 
		ManualResourceLoader* loader, D3D10Device & device)
		: HighLevelGpuProgram(creator, name, handle, group, isManual, loader)
		, mpMicroCode(NULL), mErrorsInCompile(false), mConstantBuffer(NULL), mDevice(device), 
		mpIShaderReflection(NULL), mShaderReflectionConstantBuffer(NULL), mpVertexShader(NULL)//, mpConstTable(NULL)
	{
		if ("Hatch_ps_hlsl" == name)
		{
			mpMicroCode = NULL;
		}
		ZeroMemory(&mConstantBufferDesc, sizeof(mConstantBufferDesc)) ;
		ZeroMemory(&mShaderDesc, sizeof(mShaderDesc)) ;

		if (createParamDictionary("D3D10HLSLProgram"))
		{
			setupBaseParamDictionary();
			ParamDictionary* dict = getParamDictionary();

			dict->addParameter(ParameterDef("entry_point", 
				"The entry point for the HLSL program.",
				PT_STRING),&msCmdEntryPoint);
			dict->addParameter(ParameterDef("target", 
				"Name of the assembler target to compile down to.",
				PT_STRING),&msCmdTarget);
			dict->addParameter(ParameterDef("preprocessor_defines", 
				"Preprocessor defines use to compile the program.",
				PT_STRING),&msCmdPreprocessorDefines);
			dict->addParameter(ParameterDef("column_major_matrices", 
				"Whether matrix packing in column-major order.",
				PT_BOOL),&msCmdColumnMajorMatrices);
		}

	}
コード例 #4
0
 //-----------------------------------------------------------------------------
 D3D11GpuProgram::D3D11GpuProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
     const String& group, bool isManual, ManualResourceLoader* loader, D3D11Device & device) 
     : GpuProgram(creator, name, handle, group, isManual, loader), 
     mDevice(device)
 {
     if (createParamDictionary("D3D11GpuProgram"))
     {
         setupBaseParamDictionary();
     }
 }
コード例 #5
0
GLGpuProgram::GLGpuProgram(ResourceManager* creator, const String& name, 
    ResourceHandle handle, const String& group, bool isManual, 
    ManualResourceLoader* loader) 
    : GpuProgram(creator, name, handle, group, isManual, loader)
{
    if (createParamDictionary("GLGpuProgram"))
    {
        setupBaseParamDictionary();
    }
}
コード例 #6
0
	//-----------------------------------------------------------------------
	//-----------------------------------------------------------------------
	UnifiedHighLevelGpuProgram::UnifiedHighLevelGpuProgram(
		ResourceManager* creator, const String& name, ResourceHandle handle,
		const String& group, bool isManual, ManualResourceLoader* loader)
		:HighLevelGpuProgram(creator, name, handle, group, isManual, loader)
	{
		if (createParamDictionary("UnifiedHighLevelGpuProgram"))
		{
			setupBaseParamDictionary();

			ParamDictionary* dict = getParamDictionary();

			dict->addParameter(ParameterDef("delegate", 
				"Additional delegate programs containing implementations.",
				PT_STRING),&msCmdDelegate);
		}

	}
コード例 #7
0
ファイル: OgreGLSLProgram.cpp プロジェクト: brock7/TianLong
	//-----------------------------------------------------------------------
    GLSLProgram::GLSLProgram(ResourceManager* creator, 
        const String& name, ResourceHandle handle,
        const String& group, bool isManual, ManualResourceLoader* loader)
        : HighLevelGpuProgram(creator, name, handle, group, isManual, loader)
    {
		// add parameter command "attach" to the material serializer dictionary
        if (createParamDictionary("GLSLProgram"))
        {
            setupBaseParamDictionary();
            ParamDictionary* dict = getParamDictionary();

            dict->addParameter(ParameterDef("attach", 
                "name of another GLSL program needed by this program",
                PT_STRING),&msCmdAttach);
        }
        // Manually assign language now since we use it immediately
        mSyntaxCode = "glsl";

		// want scenemanager to pass on surface and light states to the rendersystem
		mPassSurfaceAndLightStates = true;

        
    }