How to render different objects in different viewport with opengl3.3 - opengl

I am a newbie of opengl. in the scene, there are, e.g, five objects (a,b,c,d,e), I want to render (a, b, c) to the left viewport(window is divided to left/right viewports), and (d, e) to the right viewport.
I searched a lot posts, some work with traditional opengl without shader, some work with opengl 4.1 which I think some display cards have some compatibility issues.
But I use dear imgui, glfw and opengl3.3 (glsl330), and I think there should be some stuff inserted to fragment shader to make magic happen. however I cannot find anything useful in the internet maybe my search skill is not good, so I hope someone can kindly help me out, thanks in advance!

Related

OpenGL transparent effects displayed quite awful on Meego

we've been creating several half-transparent 3D cubes in a scene by OpenGL which displays very good on Windows 7 and Fedora 15, but become quite awful on Meego system.
This is what it looks like on my Fedora 15 system:
This is what it looks like on Meego. The color of the line has been changed by us, otherwise the cubes you see would be more pathetic:
The effects are implemented by just using the normal glColor4f function, and made to be transparent just by setting the value of alpha. How could it be like that?
Both freeglut and openglut have been tried on the Meego system and failed to display any better.
I've even tried to use an engine like irrlicht to implement this instead but there would be nothing but black on the screen when the zBuffer argument of beginScene method was set to be false (and normal when it's true, but that would not be what we want).
This should not be the problem of the display card or the driver, because we've seen a 3D game with a transparent ball involved on the very same netbook and system.
We failed to find the reason here. Could any one give any help on why this would be happening please?
It sounds as if you may be relying on default settings (or behavior), which may be different between platforms.
Are you explicitly setting any of OpenGL's blend properties, such as glBlendFunc? If you are, it may help to post the relevant code that does this.
One of the comments mentioned sorting your transparent objects. If you aren't, that's something you might want to consider to achieve more accurate results. In either case, that behavior should be the same from platform to platform so I would have guessed that's not your issue.
Edit:
One other thought. Are you setting glCullFace? It could be that your transparent faces are being culled because of your vertex winding.
Both freeglut and openglut have been tried on the Meego system and failed to display any better.
Those are just simple windowing frameworks and have no effect whatsoever on the OpenGL execution.
Somewhere in your blending code you're messing up. From the looks of the correct rendering I'd say your blend function there is glBlendFunc(GL_ONE, GL_ONE), while on Meego it's something like glBlendFunc(GL_SRC_ALPHA, GL_ONE).

Rendering problem with the OpenGL GL_POINTS primitive

When using software rendering, or any graphics card in our developlment office, our little coloured GL_POINTS render in exactly the colour we expect. Out in the field, some users report points rendered in the wrong colours. Getting them to turn off hardware acceleration fixed their problem, so we've been putting the whole thing down to a third-party issue and using a workaround (tiny pixel-sized rectangles whose colour remains unproblematic). The snag: we are taking a huge performance hit.
My question is, has anyone else had a similar issue, and, if so, did they come up with a way to keep their GL_POINTS and get the colour right?
I haven't encountered similar problem, but the solution is simple : get the card your user is using, and set the same environment.
Maybe the problem is something stupid as old drivers. I don't see what else can render wrong color.

Playing with OpenGL

Just learning the basics of OpenGL for a class and was looking for something challenging and interesting to try and draw. Any suggestions?
Aiming to photorealism (just plain models, lights, materials, textures, etc.) is one thing, but what is even more interesting in my opinion is demoscene and all kinds of non-photorealistic effects. The idea of a demo is to program some nice animated graphics that automatically change from one effect to another or tell some sort of a story, and have a background music. Here you can find some videos. Just take a look at what some others have done and use your imagination. That's the funniest part of 3D programming in my opinion. Of course what you'll first program would be something extremely simple when compared to those videos on youtube, but everyone has to start from somewhere. Simple also doesn't need to be ugly. Some random suggestions:
mathematical shapes with sin(), cos(), etc.
alpha blending, especially addition blending (glBlendFunc(GL_ONE, GL_ONE);)
terrain rendering
read 3d model data from a file. (Wavefront .OBJ is a relatively simple one)
feedback effects with glCopyTexImage2D, which copies pixels from screen to a texture (in real life you shouldn't use this because it's too slow, but when learning the basics it's ok)
etc...
You might consider building an OBJ viewer. You will get the experience you're looking for, and it's a pretty good project for a beginning 3D graphics programmer, in terms of difficulty.
I believe opengl has built in shapes such as a teapot that you can call and have it draw. For starters, I'd stick with easy shapes like squares, circles, and cones. Try drawing a wireframe model first since that's the easiest, by using either quadstrips ,triangles or just poly lines. After you've gotten that down, learn to set up lighting and materials so you can draw a solid model.
At school we had a very interesting assignement to get started with OpenGL that I will share. The long term goal was to modelize a living room so you basically have to draw:
A table.
Two chairs.
A carpet.
A sofa
Some stuff that you might find interesting to add on the table for
instance a TV!
When you have all the things done, try to polish the scene a little bit by adding some lighting effects!
Hint: for all the objects you simply need to start with a basic rectangle. Then you can construct your scene step by step using translations/rotations.

Totally Stuck -- Need Models but none available - What to do?

So I've got this class where I have to make a simple game in OpenGL.
I want to make space invanders (basically).
So how in the world should I make anything appear on my screen that looks decent at all? :(
I found some code, finally, that let me import a 3DS object. It was sweet I thought and went and put it in a class to make it a little more modular and usable (http://www.spacesimulator.net/tut4_3dsloader.html).
However, either the program I use (Cheetah3d) is exporting the uv map incorrectly and/or the code for reading in a .bmp that ISN'T the one that came with the demo. The image is all weird. Very hard to explain.
So I arrive at my question. What solution should I use to draw objects? Should I honestly expect to spend hours guessing at vertices to make a space invader ship? Then also try to map a decent texture to this object as well? The code I am using draws the untextured object just fine but I can't begin to go mapping the texture to it because I don't know what vertices correspond to what polygons etc.
Thanks SO for any suggestions on what I should do. :D
You could draw textured quads, provided you have a texture loader.
I really wouldn't worry too much about your "uv map" - if you can get your vertices right then you can generally cludge something anyway. That's what I'd do.

How to use opengl to create cylinder effect

I would like to know how to create 'cylinder effect', like the top site feature in safari 4, here is a picture
http://www.macworld.com/article/139022/2009/02/safari4firstlook.html
Can you tell me what should i learn , how to get started?
I would start by working through the OpenGL tutorials on NeHe's website. You might also want to invest in the Red Book. Topics you'll be interested in: Geometry and texture mapping. I think NeHe even has an example of texture mapping on a cylinder.
Depending on what you hope to accomplish, you might be able to use the Visualization Toolkit to draw a texture on a cylinder in 100 lines of code or less. There's a bit of a learning curve to VTK (and OpenGL for that matter), but the vtkTextureMapToCylinder class and the TCL example of how to use it are good places to get started.
Please download iCarousel. It has many types of cylindrical effects in it.Use whichever is useful for you.