(Solved)Question about BlendOperation(SOLVED)
Re: Question about BlendOperation
You set the shadingLanguage to video::EGSL_CG, but then pass a hlsl shader.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Re: Question about BlendOperation
Hmm Interesting never saw that, I changed it to
Sadly It changed nothing though.
Code: Select all
video::EGSL_DEFAULT
Sadly It changed nothing though.
Re: Question about BlendOperation
--Edit: forget about this, I misunderstood everything--
HLSL doesn't work with OpenGL. Either change your driver type to EDT_DIRECT3D9, or use this GLSL equivalent to saturation.hlsl (I'm not sure if this will work):
Then you'll need to specify the paths of the new shaders:
HLSL doesn't work with OpenGL. Either change your driver type to EDT_DIRECT3D9, or use this GLSL equivalent to saturation.hlsl (I'm not sure if this will work):
Code: Select all
//saturation_vertexShader.vert
uniform mat4 matViewProjection;
varying vec2 texCoord;
void main(void) {
gl_Position = matViewProjection*gl_Vertex;
texCoord = gl_MultiTexCoord0.xy;
}
Code: Select all
//saturation_fragmentShader.frag
uniform sampler2D TextureSampler;
varying vec2 texCoord;
void main(void) {
vec4 Color = texture2D(TextureSampler, texCoord);
gl_FragColor = clamp((Color - 0.3) / (1.0 - 0.3),0.0,1.0);
}
Code: Select all
//don't use absolute paths
psFileName4 = "saturation_vertexShader.vert";
vsFileName4 = "saturation_fragmentShader.frag";
video::IGPUProgrammingServices* gpu = driver->getGPUProgrammingServices();
s32 saturation_pass = video::EMT_SOLID;
if (gpu)
{
Saturation_Shader* mc_12 = new Saturation_Shader();
const video::E_GPU_SHADING_LANGUAGE shadingLanguage =
video::EGSL_CG; video::EGSL_DEFAULT;
saturation_pass = gpu->addHighLevelShaderMaterialFromFiles(
vsFileName4, "vs_main", video::EVST_VS_1_0,
psFileName4, "ps_main", video::EPST_PS_1_0,
mc_12, video::EMT_SOLID, 0, shadingLanguage);
mc_12->drop();
}
Last edited by juanjpro on Sun Nov 30, 2014 4:37 pm, edited 1 time in total.
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Re: Question about BlendOperation
Man I'm going to be honest I'm not sure why your telling me OpenGL doesn't work with DirectX? I know this.
Nowhere in my code which is just Irrlicht's simple RTT example do I say use OpenGL drivers but then pass an HLSL shader.
Those are just Irrlicht's default layout in the tutorials to check If the driver used is OpenGL or DirectX. I stated that this is a very simple app to test the problem.
If what your suggesting was actually the problem then none of my shaders would not work, not just one of them.
Nowhere in my code which is just Irrlicht's simple RTT example do I say use OpenGL drivers but then pass an HLSL shader.
Those are just Irrlicht's default layout in the tutorials to check If the driver used is OpenGL or DirectX. I stated that this is a very simple app to test the problem.
If what your suggesting was actually the problem then none of my shaders would not work, not just one of them.
Re: Question about BlendOperation
Sorry, my mistake.The_Glitch wrote:Nowhere in my code which is just Irrlicht's simple RTT example do I say use OpenGL drivers but then pass an HLSL shader.
After looking through this a bit better, I think you should be sending the sampler to the shader with the shader callback.
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Re: Question about BlendOperation
Just wanted to update that I fixed the problem I edited the shader, everything I was doing in the main.cpp was actually fine. I hard coded the values and did not use any float variables.
I also suspect for this particular shader saturate semantics may have been causing a problem also.
Thanks to CuteAlien and juanjpro.
I also suspect for this particular shader saturate semantics may have been causing a problem also.
Thanks to CuteAlien and juanjpro.
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Re: (Solved)Question about BlendOperation(SOLVED)
Don't mind the exposure haven't edited any values just testing the setup for now.
Re: (Solved)Question about BlendOperation(SOLVED)
Cool, looking nice :-)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Re: (Solved)Question about BlendOperation(SOLVED)
This one is a more fine controlled result.
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Re: (Solved)Question about BlendOperation(SOLVED)
Even better lol Halo 3. Now only If Irrlicht supported cubemaps
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Re: (Solved)Question about BlendOperation(SOLVED)
Crazy ass bloom LOL