Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (688)
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  
  Libgdx madness again..  (Read 1326 times)
0 Members and 1 Guest are viewing this topic.
Offline trollwarrior1
« Posted 2014-01-25 08:14:24 »

Sooooo I switched from rendering by specifying int points in texture to specifying floats in TextureRegion.
This is what I ran into at SpriteBatch.draw(TextureRegion, .. , ......);

Draws a rectangle with the texture coordinates rotated 90 degrees. The bottom left corner at x,y and stretching the region to cover the given width and height. The rectangle is offset by originX, originY relative to the origin. Scale specifies the scaling factor by which the rectangle should be scaled around originX, originY. Rotation specifies the angle of counter clockwise rotation of the rectangle around originX, originY.

Any reason why would they rotate it 90 degrees? Because this is only causing problems for me.. Why do they need to rotate it 90 degrees?
Offline Riven

« JGO Overlord »

Medals: 1068
Projects: 4
Exp: 16 years

Hand over your head.

« Reply #1 - Posted 2014-01-25 15:06:29 »

Then just use the draw(...) method that doesn't rotate 90deg... Clueless

public void draw(TextureRegion region,
        float x,
        float y,
        float originX,
        float originY,
        float width,
        float height,
        float scaleX,
        float scaleY,
        float rotation,
-        boolean clockwise

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline trollwarrior1
« Reply #2 - Posted 2014-01-25 15:10:54 »

Ow sorry... I kinda looked at all methods that accept TexReg, but somehow I saw that all the one that have TexReg are rotated by 90.. My bad here.. Sorry..
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline trollwarrior1
« Reply #3 - Posted 2014-01-31 14:31:39 »

Uhm,.... I'm starting to find another problem really annoying. Its as if LIBgdx remakes your shader from the ground up. If some variables don't influence the output of the shader, seems like it Libgdx doesn't put that variable into shader program.

It is just really annoying. If I have a uniform variable which doesn't influence the output of the shader and I try to set it, I always get an error from Libgdx that such uniform doesn't exist, even though it does in my shader code..

Is there a way around this?
Offline Phibedy

Senior Devvie

Medals: 9

« Reply #4 - Posted 2014-01-31 14:47:57 »

are you using spritebatch?
if you use spritebatch you have to use a shader that is compatible to default spriteBatch-shader.
Offline EgonOlsen
« Reply #5 - Posted 2014-01-31 16:14:20 »

If I have a uniform variable which doesn't influence the output of the shader and I try to set it, I always get an error from Libgdx that such uniform doesn't exist, even though it does in my shader code..
That's not caused by Libgdx, it's caused by the shader compiler in your gpu driver.

Offline trollwarrior1
« Reply #6 - Posted 2014-01-31 16:28:10 »

Hmmmm. Let me explain my "problem" more.

When i try to do setUniform(getUniformLocation("uniformname")) it works. When I do setUniform("uniformname") it doesnt work. Does this mean Libgdx does those 2 operations differently? Tongue
Offline EgonOlsen
« Reply #7 - Posted 2014-01-31 16:40:35 »

I don't know what libgdx does, but the unused uniform will be removed by the shader compiler. Have you checked what getUniformLocation actually returns? Most likely 0...

Offline theagentd

« JGO Bitwise Duke »

Medals: 597
Projects: 4
Exp: 8 years

« Reply #8 - Posted 2014-02-02 03:24:34 »


"This function returns -1 if name does not correspond to an active uniform variable in program, if name starts with the reserved prefix "gl_", or if name is associated with an atomic counter or a named uniform block.

Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Dwinin (74 views)
2015-11-07 13:29:08

Rems19 (81 views)
2015-10-31 01:36:56

Rems19 (79 views)
2015-10-31 01:32:37

williamwoles (107 views)
2015-10-23 10:42:59

williamwoles (93 views)
2015-10-23 10:42:45

Jervac_ (112 views)
2015-10-18 23:29:12

DarkCart (137 views)
2015-10-16 00:58:11

KaiHH (118 views)
2015-10-11 14:10:14

KaiHH (158 views)
2015-10-11 13:26:18

BurntPizza (173 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 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‑
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!