Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Test Release  (Read 2494 times)

0 Members and 1 Guest are viewing this topic.

Jbolte

  • Newbie
  • *
  • Posts: 8
    • View Profile
Test Release
« on: January 31, 2012, 05:11:03 pm »
Hi pdinklag! First, I wanted to say that this project is great and will be quite useful. Thank you for creating it.

Second, I have downloaded the test release 3 from Github, and it will not run. I am a complete newb in knowing how to get things like that setup to run properly, so I will just tell you exactly what I did. I am running Windows 7, 64-bit, and Java 7 32-bit.

I extracted both jars from the zip file to my desktop, then double clicked on jsfml-examples.jar. A window appeared and quickly closed. Knowing running jars from the command line would display any runtime errors, I open up command prompt and run it with java -jar, and I get the following:

Quote

Failed to compile fragment shader:
ERROR: 0:14: '*' :  wrong operand types  no operation '*' exists that takes a le
ft-hand operand of type 'const int' and a right operand of type 'const float' (o
r there is no acceptable conversion)
ERROR: 0:14: '*' :  wrong operand types  no operation '*' exists that takes a le
ft-hand operand of type 'const int' and a right operand of type 'float' (or ther
e is no acceptable conversion)
ERROR: 0:14: '/' :  wrong operand types  no operation '/' exists that takes a le
ft-hand operand of type 'const int' and a right operand of type 'uniform float'
(or there is no acceptable conversion)
ERROR: 0:14: 'sin' : no matching overloaded function found - implicit conversion
 not allowed


java.io.IOException: Failed to load shader from source.
        at org.jsfml.graphics.Shader.loadFromSource(Unknown Source)
        at org.jsfml.graphics.Shader.loadFromStream(Unknown Source)
        at org.jsfml.examples.scene.ExampleScene.initialize(Unknown Source)
        at org.jsfml.examples.scene.ExampleApp.play(Unknown Source)
        at org.jsfml.examples.scene.Standalone.main(Unknown Source)


Is this something wrong with the examples, or do I need to setup something else? Do the dll files need to be in the same location, such as with LWJGL programs, or does jsfml.jar take care of this?

Thanks!

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
Test Release
« Reply #1 on: January 31, 2012, 05:43:45 pm »
Hey there! Thanks for trying out that example. It was only so I could test it at work but good you tried it, apparently. :)

JSFML itself works fine for you, if dlls or anything were missing it would not get that far (jsfml.jar takes care of all those things). The problem is definitely with the example's fragment shader. In fact, that looks pretty interesting. Your graphics card seems to support shaders, but apparently it does not support the GLSL code I wrote.

Probably I am using a "too new" GLSL version, I am honestly not sure which, but I will sort this out.
JSFML - The Java binding to SFML.

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
Test Release
« Reply #2 on: January 31, 2012, 05:54:01 pm »
Can you try replacing your jsfml-examples.jar with the one in this zip file?
http://stuff.pdinklag.de/jsfml-examples-shader-fix.zip

Apparently, implicit conversions from int to float are not supported before GLSL 1.5 (OpenGL 3.2), so if your graphics card only supports an older version, this would explain the error. I should keep this in mind from now when writing shaders. :)
JSFML - The Java binding to SFML.

Jbolte

  • Newbie
  • *
  • Posts: 8
    • View Profile
Test Release
« Reply #3 on: January 31, 2012, 08:30:28 pm »
Thanks for your responses! I replaced the jar and tried again, and I got a different error about the shader. I don't know anything about shaders, so I am not much help to know what is happening. This time it says:

Code: [Select]

Failed to compile fragment shader:
ERROR: 0:14: 'f' : syntax error parse error


java.io.IOException: Failed to load shader from source.
        at org.jsfml.graphics.Shader.loadFromSource(Unknown Source)
        at org.jsfml.graphics.Shader.loadFromStream(Unknown Source)
        at org.jsfml.examples.scene.ExampleScene.initialize(ExampleScene.java:14
8)
        at org.jsfml.examples.scene.ExampleApp.play(Unknown Source)
        at org.jsfml.examples.scene.Standalone.main(Unknown Source)

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
Test Release
« Reply #4 on: January 31, 2012, 08:53:18 pm »
Argh, I officially need a GLSL course. :)
http://stuff.pdinklag.de/jsfml-examples-shader-fix-2.zip
Now this should do the trick. At least for that line...

Note to self: the "f" suffix for floats has been introduced in GLSL 1.2 (OpenGL 2.1).
JSFML - The Java binding to SFML.

Jbolte

  • Newbie
  • *
  • Posts: 8
    • View Profile
Test Release
« Reply #5 on: January 31, 2012, 09:18:49 pm »
That one worked just great. I can't believe how my graphics card only supports such an old version of OpenGL, but I suppose it's partly because I'm using a laptop.

By the way, at least you've learned some of GLSL and OpenGL. I keep trying to learn even just basic OpenGL, and I find it's very difficult, especially when I don't know C++ that well.  :)