Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About marcDion1974

  • Rank

Personal Information

  • Interests
  1. marcDion1974

    the relief mapping methods

    The reason the illusion breaks down at steep angles is because the parallax and relief mapping techniques work by shifting the texture map coordinates to create the illusion of a perspective change. The texture map coordinates cannot be pushed past the edge of the model, only along the suface. When looking straight at the center of the model the texMap can be moved freely sideways as well as up and down. At the edges of a sphere the texture map coordinates can move sideways but not up and down, instead they are now moving close and far. Also we now have a situation that is like looking at a sheet of paper from the edge instead of straight on. The illusion is created by the textureMap and it's coordinates position and if you can't see the image on the paper when looking at it's edge, you cannot see anything related to the image either, including the perspective shift. N'est pas?
  2. Find yourself a model loader, I use 3DS, it could be .LWO, or .OBJ or whatever you want......... (i)Add ->>> #include <fstream.h> at the beginning of your program Next find the draw calls-->>> //---------------------------------------------------------------------------------------- glBegin(GL_TRIANGLES); glVertex3f( pointerX[0], pointerY[0], pointerZ[0]); glVertex3f( pointerX[1], pointerY[1], pointerZ[1]); glVertex3f( pointerX[2], pointerY[2], pointerZ[2]); glEnd(); //---------------------------------------------------------------------------------------- Add something like the following to have this model loading program spit out vertex arrays which openGL loves. //---------------------------------------------------------------------------------------- ofstream out("modelNameVertexArray.cpp"); //_THIS WILL CREATE A TEXT FILE WITH THE SPECIFIED NAME //------------------------------------------------------------------------------------- glBegin(GL_TRIANGLES); //------------------------------------------------------------------------------------- glVertex3f( pointerX[0], pointerY[0], pointerZ[0]); out << pointerX[0] << pointerY[0] << pointeZ[0]<<",/n" // THESE OUTPUT LINES WILL CREATE A LINE OF CODE IN THE TEXT FILE FOR EVERY DRAW CALL. //------------------------------------ glVertex3f( pointerX[1], pointerY[1], pointerZ[1]); out << pointerX[1] << pointerY[1] << pointeZ[1] << ",/n" //------------------------------------ glVertex3f( pointerX[2], pointerY[2], pointerZ[2]); out << pointerX[2] << pointerY[2] << pointeZ[2] << ",/n" //----------------------------------------------------------------------- glEnd(); //-------------------------------------------------------------------------------------------------------------- Once you have the output file use #include "modelNameVertexArray.cpp" to include the vertex data then use something like glDrawArrays(,,); to render the model. I havn't posted the source code for this yet but I'll e-mail you a copy ->>darthidious@gmail.com
  3. marcDion1974

    GLES2.0 Tile textures wrapping/flickering

    it's hard to say without seeing the shader code, but the inconsistant flickering you're discribing can be caused by failing to initialize one of the varibles you're shader code is trying to use. For instance if you use this -->> lightdir = normalize(lightPos - position);<<--- but forget to initialize either 'lightPos' or 'position' you will end up with inconsistant flickering like what you described.
  4. marcDion1974

    GLSL Shaders?

    a shader is a method for directly manipulating the (i) vertices of a model, (ii) the individual fragments of the model , as well as the texture map coordinates Once you format a model into the proper form and send it to the video card using openGL calls you can now alter the model on a much more subtle basis. Shader programs alter the lighting characteristics of the model by using lighting formulas which can be reconfigured and re-written so far as your ability and imagination allow. The vertex processor is also capable of moving the vertices of a model individually. For a few quick examples download the CG toolkit from nVidia ->> http://developer.nvidia.com/ The language is mostly the same as glsl but with some setup differences. You should study both cg as well glsl since they are compatible with one another in the same program and all the basic concepts are the same. Also visit http://www.codesampler.com/ , as well as http://nehe.gamedev.net/. Nehe uses mostly fixed function lighting but is full of excellent openGL material. Code sampler has many shader programs. Be sure to check the [font=Verdana, Arial, Helvetica, sans-serif][size=2]User Samples [/font] at the bottom of the openGL section. Look for the following-->> It will help get the point across of shaders[font=Verdana, Arial, Helvetica, sans-serif] [/font] [font=Verdana, Arial, Helvetica, sans-serif]//---------------------------------------------------------------//user samples @ codeSampler.com Bump Mapping with GLSlang (OpenGL - C++) Author: [email="anudhyan@gmail.com"]Anudhyan Boral[/email] //--------------------------------------------------------------- Follow the next link to see a vertex processor program which creates a wavy effect that is applied to a flat tessellated plane( the thumbnail you're looking for is a green wavy mesh) http://nehe.gamedev.net/lesson.asp?index=10 It can be used for water, flags,capes or even grass blowing in the wind.. [/font]
  5. marcDion1974

    GLSL Shaders?

    The code was likely written on a relaxed rules video card such as most modern Nvidia cards. The code has type mismatched errors all through. For instance, the texture error that says "ERROR: 0:16: 'texture2D' : no matching overloaded function found " is happening because a texture map in shader programming is a vec4, but the normals are vec3. To fix this particular error : add .xyz at the end of the function ----->vec3 bump = normalize(texture2D(normalMap, gl_TexCoord[0]*2.0).xyz*2.0-1.0).xyz;<----- This feeds only the first three parameters to the vec3 bump variable, eliminating one of your errors.
  • 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!