- Timestamp:
- 09/15/08 20:40:35 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderState.cpp
r2943 r2949 97 97 mAlphaTestEnabled = false; 98 98 99 if (mUseAlphaToCoverage)99 //if (mUseAlphaToCoverage) 100 100 glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB); 101 else101 //else 102 102 glDisable(GL_ALPHA_TEST); 103 103 } … … 106 106 mAlphaTestEnabled = true; 107 107 108 if (mUseAlphaToCoverage)108 /*if (mUseAlphaToCoverage) 109 109 glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB); 110 110 else 111 111 glEnable(GL_ALPHA_TEST); 112 */ 112 113 } 113 114 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r2948 r2949 550 550 void InitFBO() 551 551 { 552 PrintGLerror("fbo start"); 552 553 // this fbo basicly stores the scene information we get from standard rendering of a frame 553 554 // we store colors, normals, positions (for the ssao) … … 946 947 state.Reset(); 947 948 949 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 950 948 951 if (!fbo) InitFBO(); fbo->Bind(); 952 949 953 glDrawBuffers(1, mrt); 950 954 … … 952 956 cgGLDisableProfile(RenderState::sCgVertexProfile); 953 957 954 glClear(GL_ COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);958 glClear(GL_DEPTH_BUFFER_BIT); 955 959 956 960 glDisable(GL_MULTISAMPLE_ARB); … … 958 962 state.SetRenderType(RenderState::DEPTH_PASS); 959 963 state.SetUseAlphaToCoverage(false); 960 964 965 glDisable(GL_ALPHA_TEST); 966 glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB); 961 967 962 968 state.Reset(); … … 966 972 967 973 glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 974 975 PrintGLerror("here095"); 968 976 969 977 break; … … 1071 1079 1072 1080 1073 if ((renderType == RenderState::DEFERRED) )//|| (renderType == RenderState::DEPTH_PASS_DEFERRED))1081 if ((renderType == RenderState::DEFERRED) || (renderType == RenderState::DEPTH_PASS_DEFERRED)) 1074 1082 { 1075 1083 //glPopAttrib(); … … 1901 1909 void RenderVisibleObjects() 1902 1910 { 1903 /*if ((renderType == RenderState::DEPTH_PASS_DEFERRED))1904 {1905 //glDisable(GL_LIGHTING);1906 state.SetUseAlphaToCoverage(false);1907 //FrameBufferObject::Release();1908 InitDeferredRendering();1909 1910 glClear(GL_COLOR_BUFFER_BIT || GL_DEPTH_BUFFER_BIT);1911 // draw to 3 color buffers1912 glDrawBuffers(3, mrt);1913 }1914 else*/1915 state.SetRenderType(RenderState::FIXED);1916 1917 state.Reset();1918 1919 glShadeModel(GL_SMOOTH);1920 glEnable(GL_LIGHTING);1921 1922 glDisable(GL_ALPHA);1923 glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB);1924 1925 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);1926 1927 1911 // draw all objects that have exactly the same depth as the current sample 1928 1912 //glDisable(GL_DEPTH_TEST); 1929 1913 glDepthFunc(GL_LEQUAL); 1930 cout << "visible: " << (int)traverser->GetVisibleObjects().size() << endl; 1914 1915 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 1916 PrintGLerror("here05"); 1917 if (renderType == RenderState::DEPTH_PASS_DEFERRED) 1918 { 1919 if ((renderType == RenderState::DEFERRED) || (renderType == RenderState::DEPTH_PASS_DEFERRED)) 1920 { 1921 // set modelview matrix for shaders 1922 cgGLSetStateMatrixParameter(sModelViewProjMatrixParam, 1923 CG_GL_MODELVIEW_PROJECTION_MATRIX, 1924 CG_GL_MATRIX_IDENTITY); 1925 1926 static Matrix4x4 identity = IdentityMatrix(); 1927 cgGLSetMatrixParameterfc(Transform3::sModelMatrixParam, (const float *)identity.x); 1928 } 1929 1930 PrintGLerror("here06"); 1931 1932 glDisable(GL_LIGHTING); 1933 state.SetUseAlphaToCoverage(false); 1934 1935 glViewport(0, 0, texWidth, texHeight); 1936 InitDeferredRendering(); 1937 1938 PrintGLerror("here07"); 1939 //glClear(GL_COLOR_BUFFER_BIT); 1940 // draw to 3 color buffers 1941 glDrawBuffers(3, mrt); 1942 PrintGLerror("here08"); 1943 //glClear(GL_DEPTH_BUFFER_BIT); 1944 } 1945 else 1946 state.SetRenderType(RenderState::FIXED); 1947 1948 PrintGLerror("here2"); 1949 state.Reset(); 1950 1951 PrintGLerror("here7"); 1952 1953 glShadeModel(GL_SMOOTH); 1954 glEnable(GL_LIGHTING); 1955 1956 PrintGLerror("here8"); 1957 1958 glDisable(GL_ALPHA_TEST); 1959 glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB); 1960 1961 PrintGLerror("here9"); 1962 1963 PrintGLerror("here3"); 1964 1965 //cout << "visible: " << (int)traverser->GetVisibleObjects().size() << endl; 1931 1966 1932 1967 SceneEntityContainer::const_iterator sit, … … 1942 1977 glDepthFunc(GL_LESS); 1943 1978 state.SetUseAlphaToCoverage(true); 1979 1980 PrintGLerror("visibleobjects"); 1944 1981 } 1945 1982 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg
r2928 r2949 112 112 pix.pos = IN.worldPos * maxDepth; 113 113 114 //pix.norm.xyz = IN.normal * 0.5f + float3(0.5f);115 114 pix.norm.xyz = IN.normal; 116 115
Note: See TracChangeset
for help on using the changeset viewer.