Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (796)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (864)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Texture bleed?  (Read 2928 times)
0 Members and 1 Guest are viewing this topic.
Offline steveyg90
« Posted 2016-08-22 16:42:43 »

Hi,
When I have a texture with some transparency for the water, it is being drawn like this:



any ideas?

Thanks
Offline ziozio
« Reply #1 - Posted 2016-08-22 18:23:26 »

You might need to actual provide some information as to what is wrong and how you are currently doing what is wrong. We are not mind readers  Cheesy
Offline steveyg90
« Reply #2 - Posted 2016-08-22 19:09:29 »

 Cool

I use GIMP for my artwork, so the water tile is part of a big texture, I apply color to alpha using gimp for that particular tile so its
'see through', when drawn in my game I get the artifacts that are shown.

The code below is what is used to render from a 2d array (there's some other stuff for occlusion culling etc, but this is the drawing part):

1  
   worldMap[col][row].draw(batch, region, col, row);


Where worldMap is a 2d array of type BlankEntity and draw method is as simple as:

1  
2  
3  
   public void draw(Batch batch, TextureRegion[][] t, int x, int y) {
      batch.draw(t[2][0], x << 4, y << 4);
   }


Does this help at all?  Like I said, it is only when I've applied color to alpha to that particular tile...Was thinking it maybe needs blend function setting or something?

Thanks
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Ecumene

JGO Kernel


Medals: 200
Projects: 4
Exp: 8 years


I did not hit her! I did not!


« Reply #3 - Posted 2016-08-22 19:38:29 »

It doesn't look like texture-bleeding.
It could be that in your transparent image, you have a little bit still in the bottom-left (It looks like one pixel, and it could be very transparent). Open it in gimp and select that area, then press CTRL+X to cut out all the pixels.

Offline steveyg90
« Reply #4 - Posted 2016-08-22 19:48:05 »

Lol,

Yep, on zooming in it was a stray pixel!  I spent over an hour modifying my code too...

Many thanks.
Offline Ecumene

JGO Kernel


Medals: 200
Projects: 4
Exp: 8 years


I did not hit her! I did not!


« Reply #5 - Posted 2016-08-22 23:17:12 »

I've had worse:


Offline steveyg90
« Reply #6 - Posted 2016-08-23 10:36:52 »

Lol, yeah ;-)
Pages: [1]
  ignore  |  Print  
 
 

 
hadezbladez (3625 views)
2018-11-16 13:46:03

hadezbladez (1292 views)
2018-11-16 13:41:33

hadezbladez (3631 views)
2018-11-16 13:35:35

hadezbladez (695 views)
2018-11-16 13:32:03

EgonOlsen (3997 views)
2018-06-10 19:43:48

EgonOlsen (4525 views)
2018-06-10 19:43:44

EgonOlsen (2686 views)
2018-06-10 19:43:20

DesertCoockie (3546 views)
2018-05-13 18:23:11

nelsongames (3698 views)
2018-04-24 18:15:36

nelsongames (4721 views)
2018-04-24 18:14:32
Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!