SetGlobalShaderProperty() private method

private SetGlobalShaderProperty ( string propertyName ) : void
propertyName string
return void
コード例 #1
0
 static public int SetGlobalShaderProperty(IntPtr l)
 {
     try {
         UnityEngine.RenderTexture self = (UnityEngine.RenderTexture)checkSelf(l);
         System.String             a1;
         checkType(l, 2, out a1);
         self.SetGlobalShaderProperty(a1);
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #2
0
 static int QPYX_SetGlobalShaderProperty_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 2);
         UnityEngine.RenderTexture QPYX_obj_YXQP = (UnityEngine.RenderTexture)ToLua.CheckObject <UnityEngine.RenderTexture>(L_YXQP, 1);
         string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 2);
         QPYX_obj_YXQP.SetGlobalShaderProperty(QPYX_arg0_YXQP);
         return(0);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
コード例 #3
0
 static int SetGlobalShaderProperty(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityEngine.RenderTexture obj = (UnityEngine.RenderTexture)ToLua.CheckObject(L, 1, typeof(UnityEngine.RenderTexture));
         string arg0 = ToLua.CheckString(L, 2);
         obj.SetGlobalShaderProperty(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #4
0
ファイル: ImageEffects.cs プロジェクト: ChrAfonso/imagination
 /// Copies one render texture onto another.
 public static void Blit(RenderTexture source, Rect sourceRect, RenderTexture dest, Rect destRect, BlendMode blendMode)
 {
     // Make the destination texture the target for all rendering
     RenderTexture.active = dest;
     // Assign the source texture to a property from a shader
     source.SetGlobalShaderProperty ("__RenderTex");
     // Set up the simple Matrix
     GL.PushMatrix ();
     GL.LoadOrtho ();
     Material blitMaterial = GetBlitMaterial(blendMode);
     for (int i = 0; i < blitMaterial.passCount; i++) {
         blitMaterial.SetPass (i);
         DrawQuad();
     }
     GL.PopMatrix ();
 }
コード例 #5
0
    // Performs one blur iteration.
    public void FourTapCone(RenderTexture source, RenderTexture dest, int iteration)
    {
        RenderTexture.active = dest;
        source.SetGlobalShaderProperty ("__RenderTex");

        float offsetX = (.5F+iteration*blurSpread) / (float)source.width;
        float offsetY = (.5F+iteration*blurSpread) / (float)source.height;
        GL.PushMatrix ();
        GL.LoadOrtho ();

        for (int i = 0; i < material.passCount; i++) {
            material.SetPass (i);
            Render4TapQuad( dest, offsetX, offsetY );
        }
        GL.PopMatrix ();
    }
コード例 #6
0
	public void OnRenderImage(RenderTexture src, RenderTexture dst){
		Graphics.Blit(src, myRT);
		RenderTexture.active = dst;
		//sets the global shader property of the material to be src
		src.SetGlobalShaderProperty ("_RenderTexy");
		GL.PushMatrix ();
		GL.LoadOrtho ();
		// activate the first pass (in this case we know it is the only pass)
		mat.SetPass (0);
		// draw a quad that covers the viewport
		GL.Begin (GL.QUADS);
		GL.TexCoord2 (0, 0); GL.Vertex3 (0, 0, 0.1f);
		GL.TexCoord2 (1, 0); GL.Vertex3 (1, 0, 0.1f);
		GL.TexCoord2 (1, 1); GL.Vertex3 (1, 1, 0.1f);
		GL.TexCoord2 (0, 1); GL.Vertex3 (0, 1, 0.1f);
		GL.End ();
		GL.PopMatrix ();
	}
コード例 #7
0
	static int SetGlobalShaderProperty(IntPtr L)
	{
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("UnityEngine.RenderTexture.SetGlobalShaderProperty");
#endif
		try
		{
			ToLua.CheckArgsCount(L, 2);
			UnityEngine.RenderTexture obj = (UnityEngine.RenderTexture)ToLua.CheckObject<UnityEngine.RenderTexture>(L, 1);
			string arg0 = ToLua.CheckString(L, 2);
			obj.SetGlobalShaderProperty(arg0);
			return 0;
		}
		catch (Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}
コード例 #8
0
ファイル: OVRUtils.cs プロジェクト: iveos/SIG-ET-2015-OR
	/// <summary>
	/// Blit - Copies one render texture onto another through a material
	/// flip will flip the render horizontally
	/// </summary>
	/// <param name="source">Source.</param>
	/// <param name="dest">Destination.</param>
	/// <param name="m">M.</param>
	/// <param name="flip">If set to <c>true</c> flip.</param>
	public void Blit (RenderTexture source, RenderTexture dest, Material m, bool flip) 
	{
		Material material = m;
		
		// Make the destination texture the target for all rendering
		RenderTexture.active = dest;  		
		
		// Assign the source texture to a property from a shader
		source.SetGlobalShaderProperty ("_MainTex");	
		
		// Set up the simple Matrix
		GL.PushMatrix ();
		GL.LoadOrtho ();
		for(int i = 0; i < material.passCount; i++)
		{
			material.SetPass(i);
			DrawQuad(flip);
		}
		GL.PopMatrix ();
	}
コード例 #9
0
 private void SetupTexture()
 {
     if (myRenderTexture!=null) {
         myRenderTexture.Release();
     }
     myRenderTexture=new RenderTexture(Screen.width, Screen.height, 16);
     if (SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.Depth)) {
         myRenderTexture.format=RenderTextureFormat.Depth;
     }
     myRenderTexture.Create();
     myRenderTexture.filterMode=FilterMode.Point;
     RenderTexture.active=myRenderTexture;
     myRenderTexture.SetGlobalShaderProperty("_GrassDepthTex");
 }
コード例 #10
0
    //---------------------------------------------------------------------------------------------------------------------------------------------------
    void CreateAssets()
    {
        // Create camera
        if ( !m_shadowCamera )
        {
            m_shadowCamera = CreateRenderCamera( "Valve Shadow Camera" );
            m_cullLightsInSceneEditor = false;
            m_cullLightsFromEditorCamera = false;
            m_hideAllValveMaterials = false;
        }

        // Shadow depth texture
        if ( !m_shadowDepthTexture || ( m_shadowDepthTexture.width != m_valveShadowTextureWidth ) || ( m_shadowDepthTexture.height != m_valveShadowTextureHeight ) )
        {
            if ( m_shadowDepthTexture )
            {
                DestroyImmediate( m_shadowDepthTexture );
                m_shadowDepthTexture = null;
            }

            m_shadowDepthTexture = new RenderTexture( m_valveShadowTextureWidth, m_valveShadowTextureHeight, 24, RenderTextureFormat.Shadowmap, RenderTextureReadWrite.Linear );
            if ( m_shadowDepthTexture )
            {
                m_shadowDepthTexture.name = "m_shadowDepthTexture";
                m_shadowDepthTexture.hideFlags = HideFlags.HideAndDontSave;
                m_shadowDepthTexture.useMipMap = false;
                m_shadowDepthTexture.filterMode = FilterMode.Bilinear;
                m_shadowDepthTexture.wrapMode = TextureWrapMode.Clamp;
                m_shadowDepthTexture.antiAliasing = 1;
                m_shadowDepthTexture.Create();
                m_shadowDepthTexture.SetGlobalShaderProperty( "g_tShadowBuffer" );
                //Shader.SetGlobalTexture( "g_tShadowBuffer", m_shadowDepthTexture );
                #if ( UNITY_EDITOR )
                {
                    EditorUtility.SetDirty( this );
                }
                #endif
            }
            else
            {
                Debug.LogWarning( "ERROR! Cannot create shadow depth texture!\n" );
            }
        }

        // Cast shadows shader
        if ( !m_shaderCastShadows )
        {
            m_shaderCastShadows = Resources.Load( "vr_cast_shadows" ) as Shader;
            if ( !m_shaderCastShadows )
            {
                Debug.LogWarning( "ERROR! Can't find Resources/vr_cast_shadows!\n" );
            }
            else if ( !m_shaderCastShadows.isSupported )
            {
                Debug.LogWarning( "ERROR! Resources/vr_cast_shadows not supported!\n" );
            }
        }

        // Shadows vis shader and material
        #if ( UNITY_EDITOR )
        {
            if ( !m_shaderShadowVis )
            {
                m_shaderShadowVis = Resources.Load( "vr_shadow_vis" ) as Shader;
                if ( !m_shaderShadowVis )
                {
                    Debug.LogWarning( "ERROR! Can't find Resources/vr_shadow_vis!\n" );
                }
                else if ( !m_shaderShadowVis.isSupported )
                {
                    Debug.LogWarning( "ERROR! Resources/vr_shadow_vis not supported!\n" );
                }
                else
                {
                    m_materialShadowVis = new Material( m_shaderShadowVis );
                    m_materialShadowVis.hideFlags = HideFlags.HideAndDontSave;
                }
            }
        }
        #endif
    }
コード例 #11
0
    // Downsamples the texture to a quarter resolution.
    private void DownSample4x(RenderTexture source, RenderTexture dest)
    {
        RenderTexture.active = dest;
        source.SetGlobalShaderProperty ("__RenderTex");

        float offsetX = 1.0f / (float)source.width;
        float offsetY = 1.0f / (float)source.height;

        GL.PushMatrix ();
        GL.LoadOrtho ();
        for (int i = 0; i < material.passCount; i++)
        {
            material.SetPass (i);
            Render4TapQuad( dest, offsetX, offsetY );
        }
        GL.PopMatrix ();
    }
コード例 #12
0
    // Performs one blur iteration.
    private void FourTapCone( RenderTexture source, RenderTexture dest, int iteration )
    {
        RenderTexture.active = dest;
        source.SetGlobalShaderProperty( "__RenderTex" );

        float offsetX = ( 0.5f + iteration*blurSpread )/source.width;
        float offsetY = ( 0.5f + iteration*blurSpread )/source.height;
        GL.PushMatrix();
        GL.LoadOrtho();

        Material mat = GetMaterial();
        for( int i = 0; i < mat.passCount; ++i )
        {
            mat.SetPass( i );
            Render4TapQuad( dest, offsetX, offsetY );
        }
        GL.PopMatrix();
    }
コード例 #13
0
ファイル: GlowEffect.cs プロジェクト: juanluislm/MindShoot
    // Downsamples the texture to a quarter resolution.
    private void DownSample4x(RenderTexture source, RenderTexture dest)
    {
        RenderTexture.active = dest;
        source.SetGlobalShaderProperty ("__RenderTex");

        downsampleMaterial.color = new Color( glowTint.r, glowTint.g, glowTint.b, glowTint.a/4.0f );

        GL.PushMatrix ();
        GL.LoadOrtho ();
        for (int i = 0; i < downsampleMaterial.passCount; i++)
        {
            downsampleMaterial.SetPass (i);
            ImageEffects.DrawGrid( 1, 1 );
        }
        GL.PopMatrix ();
    }
コード例 #14
0
ファイル: GlowEffect.cs プロジェクト: juanluislm/MindShoot
    public void BlitGlow( RenderTexture source, RenderTexture dest )
    {
        RenderTexture.active = dest;
        source.SetGlobalShaderProperty ("__RenderTex");

        compositeMaterial.color = new Color(1F, 1F, 1F, Mathf.Clamp01(glowIntensity));

        GL.PushMatrix ();
        GL.LoadOrtho ();
        for (int i = 0; i < compositeMaterial.passCount; i++) {
            compositeMaterial.SetPass (i);
            ImageEffects.DrawGrid(1,1);
        }
        GL.PopMatrix ();
    }