Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About Valeranth

  • Rank
  1. Valeranth

    Multiple shaders on the same object

    Quote:Original post by zedz youre gotta split the model up into multiple meshes if youre changing the material (shader/textures etc), thats how the hardware works u have to do set chair material draw polygons set tablematerial draw polygons u cant go notice to card (with the following polygons draw first hallf polygons in chair material + then 2nd half with table material) draw polygons I understand this, but is there a model format that allows you to easily do this? rather then having my modeller break up every object into smaller objects, think having a table top use a different shader then the legs, now we need 5 models rather then one.
  2. Valeranth

    Multiple shaders on the same object

    Quote:Original post by bzroom Yes, consider the shaders as a material, you can only have one material per draw call. if you need more than one material on one object, you'll need to break the object up into multiple drawcalls, one for each material. You may be able to get away with using a multitextureing technique instead though. You have to get creative with how you use and reuse data and passes.. I am left to wounder if this is a acceptable solution. Splitting up the meshes seems like it will annoy the mapper / modeller and greatly increat teh risk of collision failure.. Are there any know model formats that allow you to store extra data that could be used to house a shader id (Could then render with said id at run time). Also what methods are used by the professionals?
  3. Hi, I feel kidna stupid asking this but what is a good way to handle multiple shaders within a single model. I am currently using a basic room, chair and table all saved as .obj files and loaded with GLM. My first thought is that I could split these up into sections of the wall and do the shaders like that, but at the same time there has to be a better way? Anyone know one, or know a better format to load that supports this?
  4. Valeranth

    Deferred rendering light position

    Quote:Original post by undead Quote:Original post by Valeranth Quote:Original post by undead If you have a deferred shader you should be rendering lights as 3d meshs. what exactly do you mean here? Suppose you already filled your GBuffer. You have to draw a point (omni) light. The light attenuation is set so that the amount of light emitted goes to zero after 5 meters/units. To draw a full screen quad is an huge waste of resources for a light like that. What you should do is to draw a sphere with radius 5.0, centered at that light's position. By doing so, you are able to cull away pixels which will never be affected. The same applies to directional lights (with a box) and spot lights (a pyramid). Note that geometry isn't really required to precisely fit the light falloff.. instead of rendering a 2k polys sphere you could use a box. You'll waste just a few pixels, but save vertex shader power. Which solution is better depends on the application you are developing and the target platform. To my experience in a "real" scene the only light REQUIRED to be drawn as a full screen quad is the sun/moon light (because of problems with shadow mapping). Of course you can create as much "infinite" lights as you want, and perform a full screen pass for each one. Hope this helps :) Thank you for that explanation, but how would I go about doing that? would rendering the sphere with a stencil buffer work right?
  5. Valeranth

    Deferred rendering light position

    Quote:Original post by undead If you have a deferred shader you should be rendering lights as 3d meshs. what exactly do you mean here?
  6. I've ran into a small issue with my deferred rendering shader. I am working on the light pass using my own light data where I pass in values like position, diffuse, specular.. And the problem occurs with the position. I understand to make it into eye space I must multiply it by the inverse model view, how ever when I get to the lighting pass I no longer have the camera set up, thus the model view is incorrect. This also seems like a waist full method of getting the correct light position, as I only needs to be update, at most, per frame when the camera move, where as using that method I would be finding the position per pixel. My question is how do I fix this? Do I need to make a camera that stores the inverse model view and then just have it update the lights when I move, or is there a better way? Thanks
  7. Valeranth

    Best 3D sculpting software

    Im not very big into the whole animation thing, but if maya is the same type of program, and your a student. You really should check out the student stores maya lists on there website. Found Maya 2009 Unlimited 2009 Student edition... ( like 6.4k normal ) for $200. Was thinking of getting it for a friend for chrismas. But kinda expencive, and she doesnt have a computer that can take it lol
  8. uniforms are not shared between shaders, so remove them from the fragment shader where they are not needed. I have never done thing so im not sure what truly happens, but I guess opengl assumes you mean the ones that are in the fragment shader and does not even look into the vertex... For further refence if you need a value shared between the two shaders, vertex and fragment. use 'varying' or 'attribute'.. Also it might be a good idea to pick up a copy of the orange book ( OpenGL Shading Language second edition ). Its a great read ^_^
  9. Listen to Yann ^^ The gpu will optmize your code greatly, discarding unused values. Also if the uniform's value is changed before it is used (see below) the compiler will discard its uniform status. uniform vec2 value; void main(){ //without calling value first, the compiler will strip away its //uniform, it wouldnt matter what you set it to as it would always //be set to 1.0,0.0 before use value = vec2( 1.0, 0.0 ); ... } ( NOTE: I have never used a ATI card, cant say about there compiler.. Infact I've never used anything but a 6150LE for shader programming which uses nvidia's CG compiler.. )
  10. Hi, I'm looking to implement a deferred shader but need some help / advice on doing so. Currently I have found Paul's Projects but and wondering if anyone know of any other shaders using openGL. Perhaps a more tutorial based approach too :P Thanks, Val
  11. Valeranth

    OpenGl 3.0?

    Also openGL 3.0 just came out, the only driver that support it is the new nvidia driver, and its support for openGL 3.0 is beta. Also, my understanding, is that you have to use some settings menu to enable opengl 3.0 when you do have the drivers..
  12. Hi, So my friend let me borrow the masterpiece that is the orange book a few weeks ago, and I just finally gave it back to him. It is one of the few books I have to say is a MUST read. Anyways I just went to and found that they sell both the orange and red books for 107$, the only issue with this is that both of these books are already outdated with openGL 3.0, and with 3.1 coming on its heals *knock on wood* so any one have a idea when the next versions of these books will be out? Or should I just go head and by the books myself knowing that I wont get the full benefit from them that I could should I wait?
  13. Valeranth

    trying to understand new error

    change 'GLuint LoadTexture(const char * bitmap_file)' to 'GLuint skybox::LoadTexture(const char * bitmap_file)'
  14. Valeranth

    [SOLVED] help with bullet physics and a obj file

    Its not letting post the code and I can only hope it will let me post this... I was messing around and it occured to me maybe I should make a exact copy of the drawing (glmDraw) code and play around with that intill I get the same error I have. So I copyed and pasted it into a function called test and commented out the __glmWarning calls.. THIS CODE , a exact copy, FAILS THE ASSERT's.. yet if I change it from calling wrapper->test() to just calling glmDraw, the object draws fine.. Anyone have any idea what could cause this?? I've made sure the pointers are sain.. :/ EDIT: OMG why will gamedev let me post this but not my code -__- EDIT2: also by asserts I mean it fails at Assertion `triangle->vindices[j]>=1 && triangle->vindices[j]<=model->numvertices' failed.
  15. Valeranth

    [SOLVED] help with bullet physics and a obj file

    having some major issues posting the code for some reason after spending hours getting it to even let me on.. :/ ill see if I can edit this post some time...
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!