logo
IRC Archive / Freenode / #opengl / 2010 / May / 31 / 2
Cirno-chan
bruno0, what programming language are you using?
bruno0
Cirno-chan: c
Cirno-chan
bruno0, Windows?
bruno0
mac os x
Cirno-chan
=c
bruno0
how I do that?
Cirno-chan
Let me check.
Can't find any tutorials directly explaining how to do it for Mac.
(My experience with OpenGL is limited to Java+LWJGL, so... yeah.)
bruno0
Cirno-chan: hmm in java how works?
RTFM_FTW
- texture mapped quads... http://developer.apple.com/mac/library/samplecode/CocoaGL/Introduction/Intro.html#//apple_ref/doc/uid/DTS10004501-Intro-DontLinkElementID_2
- as one such example of this
- you can render (Quartz) texture directly though GL via this approach
- *text
Cirno-chan
bruno0, getting the width of each letter, drawing it into a BufferedImage, loading that into OpenGL, and drawing those textures to the screen.
Don't know what the equivalent, if existent would be for Mac's graphical libraries.
RTFM_FTW
- specifically note these files: http://developer.apple.com/mac/library/samplecode/CocoaGL/Listings/GLString_h.html#//apple_ref/doc/uid/DTS10004501-GLString_h-DontLinkElementID_9 http://developer.apple.com/mac/library/samplecode/CocoaGL/Listings/GLString_m.html#//apple_ref/doc/uid/DTS10004501-GLString_m-DontLinkElementID_10
- read what I linked :)
Cirno-chan
RTFM_FTW, care to tell me what exactly you searched for?
RTFM_FTW
- another good link (concerning performance): http://developer.apple.com/mac/library/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_intro/opengl_intro.html
- also note that the above approach is NOT what I'd use if you need a optimal text rendering path... there are MANY ways to make that faster
- if you are rendering large batches of text (which are relatively static) you can blit those into a FBO (via RTT) and display that as a single texture mapped primitive
- depending upon your needs you could also go for a lower level approach... i.e. generate one or more glyph textures (texture atlases would be handy for this if you need multiple fonts...) and use VA+VBO to generate the vertex / texture coordinate content used for per character indexing
- there ARE tools out there (for all platforms) which (a) generate glyph textures and (b) the resulting coordinate mapping required for OGL
bruno0
changing the focus of question, I have a DS that I list my lines in scene, but I have created dashed lines to make an effect, when I set this lines with null value it's still drawed on screen, how I erase it?
NoobFukaire
you don't erase, you change start so when you render it doesn't show up
*change state
bruno0
change the coords?
RTFM_FTW: I draw the text using glutBitmapCharacter one char pointer and pass it into a loop, drawing step by step
RTFM_FTW
- well GLUT bitmaps aren't viable for a shipping application... for that I'd recommend using the approaches I noted earlier
bruno0
RTFM_FTW: I had draw a dotted line but all lines now are dotted
how I draw one dotted line and change back to a solid line?
RTFM_FTW
- stipple (which I don't recommend) OR a 1D texture and the programmable pipeline
bruno0
yep
I used stipple
but when I try draw a solid line without stipple set
RTFM_FTW
- ugh use the second approach I mentioned... this *is* the way forward
bruno0
it's cames dotted like stipple has set
RTFM_FTW
- a simple 1D lookup texture and a fragment < program, shader >
bruno0
hmm
RTFM_FTW
- all of the crap one has to do with < stipple, non-stipple > state disappears with that approach
chroos
hello
HuntsMan
hi
chroos
i work with opengl the first time and i have some strange problems...
for example i have a class for a mesh.. i extend it to be a plane.. then i have an array of planes that i move around the screen..
sometimes there is some shaddow like thing but in the same color as the plane that always points to one of the other planes
and sometimes its pointing to the camera
how can this happen when i have only meshes with 6 points
HuntsMan
a screenshot would be helpful
chroos
i use it on a smartphone..atm
HuntsMan
you're using GL ES then
chroos
yes
RTFM_FTW
- what platform, what ES version?
chroos
android glesv1
Smirnov
are there supposed to various texture rendering qualities, because im drawing a texture flat to the screen (shouldnt be minifying/magnifying) 1:1 and yet the rendering looks incorrect
HuntsMan
chroos: grab a screenshot
Smirnov: are you using nearest filtering?
chroos
HuntsMan ill try to run it on the emulator and take a shot
RTFM_FTW
- rule #1: use the device :)
chroos
http://img691.imageshack.us/i/photo2st.jpg/
that yellow thing should only be a square..
Smirnov
HuntsMan: yes
i'm drawing a quad to the corners though [-1,1,0] [1,-1,0] etc and the window size is the same as the texture size
vade
does GL_SAMPLE_TO_ALPHA_COVERAGE actually work for non sorted transparency ? http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=237854&page=2
i cant seem to get it to work here
RTFM_FTW
- umm SAMPLE_TO_ALPHA doesn't eliminate the Z sort... not sure why you would think that it would :P
- there are ways to do that tho... this isn't one of them :P
vade
well, that doc seems like thread has examples that say, and work for others that not doing z-sort, but with depth enable, make it work :|
RTFM_FTW
- umm no it doesn't :P
vade
blah, margarita for lunch makes typing hard
RTFM_FTW
- in any case it sounds like you want OIT
vade
the cube in that example is nor sorted
er not. fu*k :D
RTFM_FTW
- see above
vade
yea , but thats not supported on OS X is it ?
RTFM_FTW
- umm you have everything you need for OIT on that platform...
- OCL for example...
- and interaction with OGL
vade
fu*k that noise :P
RTFM_FTW
- per fragment sorts + atomic operations... all of that is supportable
- on the right HW
- of course depth peeling would be another approach to this problem...
- one which is completely supported through OGL
- in any case for more information on OIT I'd start here: http://diaryofagraphicsprogrammer.blogspot.com/2009/11/order-independent-transparency.html