Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

12045 Posts in 1593 Topics- by 593 Members - Latest Member: zhang

24. May 2013, 03:43:30 am
Xith3D CommunityGeneral CategoryGeneral Discussion (Moderators: Marvin Fröhlich, 'n ddrylliog)Render and save screenshot without canvas window
Pages: [1]
Print
Author Topic: Render and save screenshot without canvas window  (Read 1485 times)
neothemachine
Just dropped in

Offline Offline

Posts: 5


View Profile
« on: 12. March 2012, 01:58:40 pm »

Hi,

Is it possible with Xith3D to lay an object (.obj) into a scene, add some lights, textures and then start rendering and save a screenshot as RGBA to a file as soon as possible? And all that without having a visible window? It should behave like a console application. If it's not possible (yet?), what parts would need to be extended/changed?

Thanks for your answer,
neo
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #1 on: 12. March 2012, 07:34:37 pm »

Well, this is all possible. But I am not sure about the invisible window. At least you should be able to position the window outside of the screen.
Logged
neothemachine
Just dropped in

Offline Offline

Posts: 5


View Profile
« Reply #2 on: 13. March 2012, 01:53:38 pm »

Ok, well, I think I can live with a hidden window. But I'm currently having problems taking screenshots with alpha. When I change the boolean in shotEngn1.takeScreenshot(false); to true (example from XIN) then I still don't have a transparent but a gray background in the saved .png. Do I have to do something else?
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #3 on: 13. March 2012, 09:47:23 pm »

Hmm... no. Should work exactly like that. Then it seems to be buggy.
Logged
neothemachine
Just dropped in

Offline Offline

Posts: 5


View Profile
« Reply #4 on: 15. March 2012, 02:37:17 pm »

It seems I have to set an OpenGL clearing color (http://www.opengl.org/sdk/docs/man/xhtml/glClearColor.xml), e.g. black with alpha 0. And also set the requested alpha bits to 8 (http://download.java.net/media/jogl/jogl-2.x-docs/javax/media/nativewindow/Capabilities.html).

Do you know which commands let me do that in xith?
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #5 on: 15. March 2012, 09:29:48 pm »

canvas.setBackgroundColor() to set the clear-color.
I don't know about the requested alpha bits.
Logged
lonesomeStranger
Becoming dependent
**
Offline Offline

Posts: 124

197432680
View Profile
« Reply #6 on: 16. March 2012, 07:31:34 pm »

@neothemachine: This can be interesting for you.
Logged

Anton
neothemachine
Just dropped in

Offline Offline

Posts: 5


View Profile
« Reply #7 on: 26. March 2012, 06:19:35 pm »

@lonesomeStranger: Thanks for the link but I also need "anti-aliased" transparency, i.e. pixels which have an alpha value between 0 and 1.
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #8 on: 27. March 2012, 08:13:47 am »

@lonesomeStranger: Thanks for the link but I also need "anti-aliased" transparency, i.e. pixels which have an alpha value between 0 and 1.

So, you want an alpha channel, not anti-aliased transparency Wink.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic