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

Author Topic: Updated from 2.0 RC to 2.0, now shader doesn't work  (Read 2097 times)

0 Members and 1 Guest are viewing this topic.

mike919

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Updated from 2.0 RC to 2.0, now shader doesn't work
« on: June 24, 2013, 05:57:28 pm »
Hi,

I've been developing an application that uses SFML for visualizing data.  I was using 2.0 RC but finally updated to the 2.0 release today and found that my code related to a fragment shader no longer works.  Here is the code with the issue:

Code: [Select]
private Shader shader;

private RenderStates states;

shader = new Shader(null, "colormaps\\threshold_and_colormap.frag");

states = new RenderStates(shader);


I don't get any compile errors.  This is pretty barebone, but I get an runtime error on the last line the states

EntryPointNotFoundException was unhandled:  Unable to find an entry point named 'sfTransform_create' in DLL 'csfml-graphics-2'.

Also, I am not sure if it matters but here is the shader code.  This worked in the RC so I dont think it is the problem.

Code: [Select]
uniform sampler2D tex;
uniform float lowThreshold;
uniform float lowColormapLimit;
uniform float highColormapLimit;

uniform sampler2D colormap;

void main()
{
//read data in
vec4 pixelIn = texture2D(tex,gl_TexCoord[0].st);

//if all all channels are 255 this is the code for no data present
if ((pixelIn[3] == 1.0) && (pixelIn[2] == 1.0) && (pixelIn[1] == 1.0) && (pixelIn[0] == 1.0))
{
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
}
else
{
//calculate the value of the pixel
float dataValue = pixelIn[3] * 4294967296.0 + pixelIn[2] * 16777216.0 + pixelIn[1] * 65536.0 + pixelIn[0] * 256.0;
vec4 newcolor;

//apply the low threshold
if (dataValue < lowThreshold)
{
newcolor = vec4(1.0, 0.0, 0.0, 1.0);
}
else
{
int index = int((dataValue - lowColormapLimit) * (255.0/(highColormapLimit - lowColormapLimit)));
if (index < 0)
{
index = 0;
}
else if (index > 255)
{
index = 255;
}
newcolor = texelFetch(colormap, ivec2(index, 0), 0);
}
gl_FragColor = newcolor;
}
}


So did anything change in the way shaders are used in the 2.0 release?  Any help would be appreciated.  Thanks

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
AW: Updated from 2.0 RC to 2.0, now shader doesn't work
« Reply #1 on: June 24, 2013, 07:03:37 pm »
Have cleaned your working space and completely rebuilt the project. Have you also replaced the old DLLs with the new one. From the error it sounds like something can't be found in the DLL, which sounds like incompatible DLL versions.

Also why are you using the CSFML version?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

mike919

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: Updated from 2.0 RC to 2.0, now shader doesn't work
« Reply #2 on: June 24, 2013, 08:37:31 pm »
Thanks for the reply.  Mixing up the DLL versions is definately a possibility that crossed my mind.  When I updated I copied the 32 bit DLLs to my bin/debug and also bin/Release directories.  I am reasonable sure that I'm doing this right because I've copied the RC dlls back into the directories to get it back into a working state for now.

These are the dlls I am copying.  I don't use any of the audio ones.
  • csfml-graphics-2.dll
  • csfml-window-2.dll
  • sfmlnet-graphics-2.dll
  • sfmlnet-window-2.dll

It's always been my understanding that when using sfmlnet dlls that the csfml dll also need to be present because the sfmlnet dll refer back to the csfml dll for all of the actual functions.  I've seen before that if they are not present you get an error that they can not be found.

Also, in my VS2010 project I have references added for sfmlnet-graphics-2.dll and sfmlnet-window-2.dll.

I've been working on this program off and on since SFML 1.6  :) and I've been using this same setup the whole time.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
AW: Updated from 2.0 RC to 2.0, now shader doesn't work
« Reply #3 on: June 24, 2013, 08:57:16 pm »
Aww sorry, on the phone I don't notice in which forum you've posted it, then again you never mentioned SFML.NET ;)

Do the DLLs all ship with the SFML.NET 2.0 package?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

mike919

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: Updated from 2.0 RC to 2.0, now shader doesn't work
« Reply #4 on: June 25, 2013, 04:44:43 pm »
No problem, seems like I always forget to mention some important piece of information  :)

Anyway, I took those lines out of the main project and created a new project with only those lines and it seems to work by itself with the new libraries.  So it must have something to do with the order I am doing things.  I'll have to try to reorder some things to see if anything changes.