• Advertisement
Sign in to follow this  

Some questions :S

This topic is 4741 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

well.. hi~ i'm learning opengl from NeHe tutorial and from some tutorials i have seen.. I have my own opengl program and there i put all my updates.. Question 1.- I use glList to save vertex, nomals, etc: My program reads an .ASE file (exported from 3ds max) then it takes all vertex and normals. it puts all that vertex in a glList and closes it. Well .. with that i dont need to use very long arrays to save vertex... buut.. My "game" is gonna have "MANGA" graphics (Cel-Shading). but, to make shades i need to change the glTexCoords everytime u move the camera.. Draw() { glCallList(list); } Lists() { glNewList(......); glBegin(..); ... glTexCoords2d(var); <--- it wont change even if u change the variable. .. ... } .... If that can't be done... can som1 tell me a way to save lots of vertex and normals without charging very long arrays ...?? Question 2.- I want to make my own Siluethe... (i don't like Cel-Shading's siluethe..) can any1 help me.. ? PS: my eng sux ~.~

Share this post


Link to post
Share on other sites
Advertisement
i think if you use vertex and pixel shaders you will be able to create the effects you are looking for without having to change the texcoords. cel-shading shouldnt need to change the texcoords at all

Share this post


Link to post
Share on other sites
Call me an old timer, but why does it always have to come to vertex and pixel shaders around here? I am not sure of the exact texture coordinate transformations you are trying to do, but almost all transformations can be modeled by matrices. Make the texcoords static, but make matrix setups to transform them based on how the camera changes.

However, that probably wont even be nessecary, because one really fast way to make Cel-Shading that you could do would be to use sphere mapping. Because of the fact that Cel-Shading needs to make the edges in screen space black if they are facing perpendicular, and sphere mapping is a screen space function that uses normals to detect texture coordinates, you can simulate Cel Shading without using static tex coords for the outline part by sphere mapping your model with a texture of a white circle inside of a black one. To see the effect, I made a two-second demo that is just a shameless copy of lesson23. The source and code are identical, I just replaced the reflection texture with one of the Cel Map textures I was talking about. Click here to download

This demo really doesnt do this technique justice, however. You will notice that it looks severly odd for several of the quadrics. However, this oddness goes away if the normals are correct and if the object is convex and closed (like almost all in-game models are). I have tried this technique in my engine before, so it could be an option for you.


That is just my two cents. Hope you figure out a way to solve your problem!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement