Problem in GLSL

Hello Every Body

i have small problem with GLSL

i work with openGL pack for netbeans (plug in of netbeans)

and it’s support me to make GLSL file

but when i try to compile and link files

it’s give me number format exception

i don’t know why

so if any one can help me to solve this problem

Thannks in Advance

Please post the messages and the shader code.

Hello ,

Thank you for your interest

that is the shader code

the frag file

/////////////////////////////////////////////////////////////////////
/*

  • fragment shader template
    */
    void main() {
    // Set the fragment color for example to gray, alpha 1.0
    gl_FragColor = vec4(0.5, 0.5, 0.5, 1.0);
    }

////////////////////////////////////////////////////////////////////

the vert file

////////////////////////////////////////////////////////////////////
/*

  • vertex shader template
    */
    void main() {
    // Vertex transformation
    gl_Position = ftransform();
    }

///////////////////////////////////////////////////////////////////

i just make this 2 classes and selet the 2 files and try to compile and link them

and i got the NumberFormatException

Thanks in Advance

I can’t reproduce this, so please post the full stacktrace of the NumberFormatException.

Hello Mr. cylab

Thank You for your reply

that is the message


java.lang.NumberFormatException: For input string: “”
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:468)
at java.lang.Integer.parseInt(Integer.java:497)
at com.mbien.engine.glsl.GLSLCompilerMessageParser.parse(GLSLCompilerMessageParser.java:41)
at net.java.nboglpack.glslcompiler.GLSLCompilerImpl.compileAndLinkProgram(GLSLCompilerImpl.java:139)
at net.java.nboglpack.glslcompiler.actions.LinkShaderAction.performAction(LinkShaderAction.java:27)
at org.openide.util.actions.NodeAction$DelegateAction$1.run(NodeAction.java:581)
at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:77)
at org.openide.util.actions.NodeAction$DelegateAction.actionPerformed(NodeAction.java:577)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1220)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1261)
at java.awt.Component.processMouseEvent(Component.java:6041)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5806)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2440)
at java.awt.Component.dispatchEvent(Component.java:4243)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)


and That is the steps that i follow

1- create simple openGL application
2- i didn’t change any thing from the template that created by netbeans
3- create GLSL frag file and also i didn’t change it
4- create GLSL vert file and also i didn’t change it
5- select frag and vert file and try to compile and link them

then i got a pop up message that contain this exception

Thanks in Advance

hello a_elsayed2010,

I can not reproduce this on a ATI X1600 and on a Geforce 7. What graphics card do you have?

I guess we need an other regexp for your model :wink: I will look into it next weekend. I also answered your mail on the mailing lists but I oversaw this thread so please ignore possible redundancies…


compiling shader: newVertexShader.vert
compiler msg:
    Vertex shader was successfully compiled to run on hardware.
compiling shader: newFragmentShader.frag
compiler msg:
    Fragment shader was successfully compiled to run on hardware.
compilation successfull
linking shaders
link successfull

I’m just guessing but this could be problem with number formatting done according current locale in nvidia GLSL compiler, I had this problem with some other software on Linux. If this is the case, just unset all LANG and LC_* environment variables before running NetBeans to workaround it.

Hello ,

i test this code on the following laptops :

     1- Acer TravelMate 2490               --> NumberFormatException
     2- Acer Aspire 5600                      --> NumberFormatException
     3- Fujitsu Simens model T4215     --> NumberFormatException
     4- HP Compaq EVO N 620c           --> Not Support GLSL

and also i search for LANG and LC_* in environment variables and i didn’t find any of them

so please how can i solve this problem

Thanks in Advance

   at com.mbien.engine.glsl.GLSLCompilerMessageParser.parse(GLSLCompilerMessageParser.java:41)

Who’s code is that? You do realise that the GLSL compiler output is highly vendor and driver dependant, and the format could change at any point, right? (ie. you can’t parse it and always expect it to contain certain numbers or formatting, which seems to be the problem).

its my code, and this is why there is a regexp field in the glslcompiler options and as I already said before I will look into it at the weekend i am currently really swamped with real work. Each chip vendor has its own compiler message format and we have them for nvidia and ati thats why I asked on which graphics card he/she is running the pack. (on unknown chips the parser shouldn’t be called which is a bug)

Well my point is that you can’t realistically provide methods to parse all vendor message formats, and even if you could they could change them at any point with a driver update. Any sort of parsing (particularly string->int conversion) must be wrapped in a try…catch block. You don’t want your game to stop working just because someone updated their drivers.

sure. The main cause of this bug is that the compiler service should be only available on nvidia and ati cards, it seems like i have removed this check in past for a reason i can’t remember. The message format hasn’t changed in the past years. Its ok for me when it breaks once in a while since we can upload updates anytime we want.

Its about the NetBeans OpenGL Pack which is a set of tools updated regularly via IDE update centers - its not a game ;).

The engine package is the worst code in the pack it wasn’t initially designed for compatibility. The main problem is that the pack is not the only open source project cylab and me are involved in. Its all about time…

Hello ,

Thank You All for your comments

i think i can said that

the four laptops doesn’t support GLSL

so … if there is any alternative to help us

please let me know

brief description about our problem

The Project Specification :

1- load 3D Environment
2- enable the user to interact with surrounded environmnet
3- the environment content painter stand that enable the user to draw on it

The Problem:

I get x , y when the user press on screen from java 2D
but I need to convert it to 3D to can draw on painter stand

if any one want to view code
just tell me

Thanks in Advance

The HP laptop has a ATI Mobility Radeon 7500 4x AGP, which should be OK. But you need a driver update (which might be difficult without using hacked drivers), so search the HP support site.

The other three afaik have Intel integrated graphics (GMA 950), which are considered to have bad drivers. Anybody out there used GLSL on one?

If it’s actually a Radeon 7500 then no driver up date will get GLSL working, Radeon’s first got GLSL support with the 9500-9800 series. Of course they’ve wrapped their number scheme around and it’s soon going to be hard to tell what’s what if you’re try to support legacy parts.

[quote]The other three afaik have Intel integrated graphics (GMA 950), which are considered to have bad drivers. Anybody out there used GLSL on one?
[/quote]
As of this moment, no Intel part supports GLSL on Windows, while some do on Mac.

Hello ,

Thank You All For Your Interest

but can any one please advice us with another solution ???

Thanks in Advance

You would never have needed GLSL for that. I can’t provide you with code, since I haven’t done it myself yet, but the idea is to cast a ray through the window coordinates and calculate a ray-plane-intersection from this ray with the parametric plane equation of your painter stand. You could use gluUnproject to generate such a ray, like briefly described in http://www.opengl.org/resources/faq/technical/selection.htm and you will probably have to transform your plane equation with the modelview matrix prior to the intersection calculation.