Jump to content

  • Log In with Google      Sign In   
  • Create Account


GLSL Shader for primitive graphics


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 borrax   Members   -  Reputation: 101

Like
0Likes
Like

Posted 19 September 2013 - 01:20 PM

I want to make primitive graphics. Instead of textured polygons I want solid color polygons, and use lines for details. I have written an entirely software based 3D renderer in java that uses that approach based on a 3D graphics book from 1995. I have an array to represent all pixels on the screen and do all the processing on CPU side, then passes the array to openGL to render as a texture on a quad, creating a full screen 320 by 240 pixel resolution. You can see the results here: https://www.youtube.com/watch?v=_XYj113Le58

 

It works, it even has a z buffer that handles transparency by depth sorting pixels, but it's slow. I think I can speed things up by doing it in the hardware with shaders and C++ ( not looking to debate java vs c++, but I am trying to get better at c++ so that what I feel like using ). My java project taught me a lot about the fixed function graphics pipeline as it existed in the early 1990s, but I can't wrap my head around shaders.

 

To make things worse, I'm trying to make a shader for bad graphics, and modern graphics programming all seems to emphasize textures, so I can't find a tutorial. 

 

I will write my "models" directly in the code, with arrays to hold vertex, polygon, and color information. I will have to pass the color for each polygon to the shader, and I don't have a clue how to do that.

 

I also need to draw lines, and need a z buffer that does depth sorting so transparency looks good, but I can try to figure those out after I have the basic knowledge about drawing polygons.

 

If you have any experience or know about any tutorials I'd appreciate it. Or even a book, I still like crappy graphics and I still like books. My computer is probably using roman numerals for 1s and 0s.



Sponsor:

#2 ScherzkeCks   Members   -  Reputation: 117

Like
0Likes
Like

Posted 19 September 2013 - 02:28 PM

Hi borrax,

 

maybe these tutorials are something for you: http://www.opengl-tutorial.org/beginners-tutorials/tutorial-2-the-first-triangle/

 

They take the modern approach with OpenGL4 (or 3.x if you use the modern stuff in 3 ;) ) and I found them quite helpful.

Other than that, if you are serious I can only recommend the RedBook which tells you pretty much everything about OpenGL. (ISBN:0321773039)






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS