Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

172 Neutral

About Jroggy

  • Rank
  1. Hi, I'm having an issue where sometimes my fog with disappear or flicker. Currently I update the fog color/start/end based on the time of day. Here's how I set up the fog: void FogParam(int param, void *value) { GLfloat* value2 = (GLfloat*)value; glFogfv(param, (const GLfloat*)value); } void InitState() // init rendering state - used because the rendering context may change { glEnable(GL_CULL_FACE); glFrontFace(GL_CCW); glCullFace(GL_BACK); glPolygonMode(GL_FRONT, GL_FILL); glDisable(GL_NORMALIZE); //glEnable(GL_NORMALIZE); glClearColor(0.f, 0.f, 0.f, 0.f); glClearDepth(1.f); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, 0.f); GLfloat amb[] = {0.f, 0.f, 0.f, 1.f}; glLightModelfv(GL_LIGHT_MODEL_AMBIENT, amb); glShadeModel(GL_SMOOTH); // default white material aColor col; col.r = col.g = col.b = col.a = 1.f; glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, (const GLfloat*)&col); glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, (const GLfloat*)&col); glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, (const GLfloat*)&col); col.r = col.g = col.b = 0.f; col.a = 1.f; glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, (const GLfloat*)&col); glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 0.f); glEnable(GL_TEXTURE_2D); glBlendFunc(GL_SRC_ALPHA,GL_ONE); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // enable texturing on second unit glActiveTextureARB(GL_TEXTURE1_ARB); glEnable(GL_TEXTURE_2D); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glActiveTextureARB(GL_TEXTURE0_ARB); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); // Default fog parameters glFogi(GL_FOG_MODE,GL_LINEAR); aColor fog_color; fog_color.r = 1.f; fog_color.g = 1.f; fog_color.b = 1.f; fog_color.a = 1.f; FogParam(A_FOG_COLOR, &fog_color); float fog_param; fog_param = 0.01f; FogParam(GL_FOG_DENSITY, &fog_param); fog_param = 50000.f; FogParam(GL_FOG_START, &fog_param); fog_param = 100000.f; FogParam(GL_FOG_END, &fog_param); //=================================== }
  2. Jroggy

    FBO Render order backwards?

    Thank you, that fixed my problem. I had been doing it earlier, but for some reason had removed it, doh! Sky is still not rendering, but I'm sure I can figure that out.
  3. Jroggy

    FBO Render order backwards?

    anyone? Still haven't been able to solve this problem.
  4. Jroggy

    The best openGL Games EVAAAR!?

    Quote:Original post by Ryman Quote:Original post by Yann L How comes OpenGL is always associated with open source ? Among all mistakes made along the development of OpenGL, one of the worst was certainly that SGI decided to name it OpenGL. Oh, and squamulus, I would dare to say that there are certainly a lot of closed source indie games out there, using OpenGL or not, whose developers are just as proud and put just as much sweat into their creation than if it was open. Probably even more so. You have no idea what you're talking about nor the difference between proprietary and open source frameworks. You've made his point. OpenGL is not open source, it is an open standard.
  5. It depends. What kind of hardware are you targeting? Are you applying the outlines to simple or complex meshes? The whole scene or only characters? Obviously the higher the meshes triangles the slower redrawing the mesh will be, with lots of complex meshes to redraw.. can get slow quickly. In this case post processing would be the best approach. If you're just rendering simple geometry, it's probably better to redraw the meshes. I also find redrawing the mesh doesn't really catch the ridge and creases very well all the time, whereas post process outlines are usually better at catching them. Hope that helps.
  6. I'm not entirely sure what the problem is... I'm using an FBO to render my reflection map into. Before I was using glCopyTexSubImage2D and everything was fine and dandy, but when I switched to FBO it looks like my models are being rendered on top of the terrain. My sky dome isn't being rendered either (but the scrolling cloud texture is). I haven't changed any of my code, except adding the FBO stuff. I'm kind of new to FBO's, do I need a depth render buffer? I tried using one, but then only the scrolling cloud texture was being rendered to the texture. Here's my initialization code: glGenTextures(1, &m_tex_col[index]); glBindTexture(GL_TEXTURE_2D, m_tex_col[index]); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, 1024, 1024, 0, GL_RGBA, GL_INT, NULL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fb); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT + index, GL_TEXTURE_2D, m_tex_col[index], 0); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); and my rendering code: int x,y,dx,dy; a_render->GetViewport(x,y,dx,dy); aMatrix *old_proj_mat=a_render->GetProjMat(); a_render->Viewport(0,0,rtt->GetWidth(),rtt->GetHeight()); glMatrixMode(GL_PROJECTION); aMatrix m; float rx,ry; a_camera->GetFOVRatio(rx,ry); float old_n,old_f; a_camera->GetPlanes(old_n,old_f); float old_fov=a_camera->GetFOV(); a_render->MakeProjMat(&m, 0.1f,30000,old_fov,rx,ry); a_camera->Planes(0.1f,30000); a_render->SetProjMat(&m); a_render->SetUnitWorldMat(); glEnable(GL_CLIP_PLANE0); GLdouble clip_plane0[4]; clip_plane0[0]=0; clip_plane0[1]=-1; clip_plane0[2]=0; clip_plane0[3]=matrix->m31; glClipPlane(GL_CLIP_PLANE0,clip_plane0); rtt->Activate(); glClearColor(0.0, 0.0, 1.0, 0.0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); a_world->RenderScene(); rtt->Deactivate(); rtt->Bind(); glDisable(GL_CLIP_PLANE0); a_camera->Planes(old_n,old_f); a_camera->FOV(old_fov); a_camera->UpdateFrustum(); a_render->SetProjMat(old_proj_mat); //disable shader a_render->SetShader(0,0); // Restore old view port and set rendering back to default frame buffer a_render->Viewport(x,y,dx,dy); Any help would be appreciated :)
  7. Quote:Original post by millennium-fox Quote:That's setting aside the language issue though. I'm not sure why C# isn't an option for you, but if you're constrained to using C++ for some reason, then Unity may not be the best choice (at least not as things stand now). I am vehemently persuading my team team in changing to C#. Problem is, you see, they are still covering the basics of c++ (still on "computer guesses my number" game). - Is the C++/C# language difference too much a contrast for this learning stage? - Would it be smarter to continue learning C++ and learn C# later on? - Is there a good C# book DIRECTED for game developers? Thank you. C# is generally easier to learn than C++. I would actually start with C#, this would make learning C++ much easier later. As for Unity, if they know javascript or boo (python variant), they could use those instead of C#.
  8. Hey guys and gals, I've recently quit my day job and gone full time into contract work. I thought it might help out others if I gave my experiences in this process. I may just crash and burn, but at least it'll serve as a deterrent if I do! Here's the link: http://tomrab.weheartgames.com/category/blog
  9. If you wanting to learn javascript I would definitely recommend "PPK on javascript". Pretty compressive look at javascript.
  10. Jroggy

    At long last... after 6 months

    Oh man.. MacPipes! I used to play this on the super old imacs when I was in school. Going to have to grab it once I have another iphone to play with :) Congrats, I just finished my first iPhone game with someone else as well. Hopefully you have more luck than us, our game is a little more unique (uses the camera), but selling horrible :(
  11. media is not covered under the GPL, but they may have a different license, so you may want to check.
  12. Jroggy

    HLSL: Random numbers

    If you can use VTF, you could use a texture filled with noise. Generally this is what I do in a pixel shader if I need a random number. Here's something else that may work, not exactly random, but it works alright. float rand(float2 co){ return 0.5+(frac(sin(dot(co.xy ,float2(12.9898,78.233))) * 43758.5453))*0.5; }
  13. Jroggy

    Making a Game Like N64?

    Quote:Original post by phazmatis Hmmm... An excellent question. I'd say that it's not the advances in hardware that will make your dream easier for you to accomplish, it would be the advances in software. For example, when the developers of N64 games were making their games, Java was not a viable language for making games. They had... assembly and C++. AFAIK, they didn't even use C++, just C.
  14. Jroggy

    PhysX on an ATI card?

    Yes, if it's not accelerated, it's done on the CPU, so it doesn't matter what card you have.
  15. Jroggy

    Cross-Hatching GLSL

    here you go : Real Time Hatching
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!