Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


chiranjivi

Member Since 27 Feb 2010
Offline Last Active Jul 02 2015 11:51 AM

Posts I've Made

In Topic: Applying alpha gradient to an image

02 July 2015 - 11:51 AM

Can you use custom shaders in your project?

 

In theory I can use shaders, yes - in practise though I've shied away from them because they seem pretty complex, and I barely have a tenuous grasp on the basics at present.

 

 

Alternatively, without shaders, you can make an image that has the alpha channel you want, and draw it onto the framebuffer with a blending mode that basically copies the alpha channel into the framebuffer without harming the RGB channels... But I wouldn't know the proper blend equation to set up for that.

 

This is the kind of thing I was hoping for - some functionality that would allow me to draw another texture over the top of what I currently have, but overwriting only the alpha channel and not touching the RGB. I'll have a look at the gl documentation about blending functions and see if anything looks particularly enlightening.


In Topic: Applying alpha gradient to an image

02 July 2015 - 11:17 AM

I don't mind the downvote - my rating balances out in the end.

 

Thank you for being reasonable about it. I didn't realise it was considered bad form to take the tooltip literally, I'll be less liberal about it in future if it upsets people (not you personally, just in the general sense).

 

I'm still not sure what you are wanting though - are you wanting specific details for how to use GDX to generate an alpha channel? Or do you already have an alpha channel in your image and are wanting to know how to make it affect the result when drawing?

 

Well, what I've actually done so far is draw a number of sprites onto a LibGDX framebuffer; having done that I'm trying to figure out how take that framebuffer and to 'fade out' its left and right edges, after which I was intending to render it onto the screen over the background. The framebuffer already contains an alpha channel, I'm just unsure how to manipulate it in order to achieve the desired effect.


In Topic: Applying alpha gradient to an image

02 July 2015 - 10:26 AM

chiranjivi, don't down vote someone because they misread your post. Servant of the Lord is correct in principle and was helpful to you. Nothing he wrote was incorrect, only the file information didn't directly apply.

 

 

The tooltip for the downvote button says 'this response is not useful', which I didn't find it to be. It seems to me like I was using it appropriately, but whatever you say, I guess.


In Topic: Applying alpha gradient to an image

02 July 2015 - 10:17 AM

 

Generate the alpha channel while generating the image.

 

I'd welcome suggestions as to how I can do that with LibGDX/OpenGL, if you have any. I understand in theory that that's what I need to do, the reason I'm asking the question is because I don't understand how to actually effect it sad.png


In Topic: Boost serialization exception problems

06 August 2014 - 09:49 AM

I have limited experience with boost::serialization but I would probably start by reducing the amount of work you do in the serialization function to home in on exactly which type is causing the issues. Once you know what exact type is causing the problems it should be much easier to figure out what goes wrong.

 

Thanks for the advice - I did this and apparently it was one of the booleans that was causing the problem (the exception code had me looking in all the wrong places!).

My tile factory function creates a Tile object and then sets all its variables depending on what type of tile it is; due to an oversight I was apparently setting a bool to an uninitialised value, and though it wasn't causing any ingame problems, Boost didn't like trying to serialize it. I'm still a bit confused about why it was throwing that particular exception code but all's well that ends well.


PARTNERS