Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (480)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (547)
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 848 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, .. , ......);

Quote
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
« League of Dukes »

JGO Overlord


Medals: 781
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

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
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 Member


Medals: 8



« 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
« Reply #8 - Posted 2014-02-02 03:24:34 »

glGetUniformLocation():

"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.

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

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (25 views)
2014-08-19 09:29:53

Tekkerue (24 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (13 views)
2014-08-16 06:20:21

Tekkerue (20 views)
2014-08-16 06:12:11

Rayexar (58 views)
2014-08-11 02:49:23

BurntPizza (38 views)
2014-08-09 21:09:32

BurntPizza (30 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!