Texture Splatting [OpenGL]
Re: Texture Splatting [OpenGL]
Ohh, and its been a few days now since i commented. So ive lost interest anyways switching to ogre.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Texture Splatting [OpenGL]
Yeah, freat bug report you made there. And your previous post is - really incredible - 60 *seconds* old. Can't really imagine why no one answered you in between. So best of luck with your patience and skills for problem reporting at the next engine.
Re: Texture Splatting [OpenGL]
'Reason' yeah have fun with OGRE its so abstracted and messy... Well I wont say any more.
Re: Texture Splatting [OpenGL]
Do you really think my brain is a peanut or something?by hybrid » Sat Oct 29, 2011 11:14 am
Yeah, freat bug report you made there. And your previous post is - really incredible - 60 *seconds* old. Can't really imagine why no one answered you in between. So best of luck with your patience and skills for problem reporting at the next engine.
Lets take look at this example:
3 days later.. No answer concerning your post.Hey, guys can you help me fix this error? It says "....."
60 seconds laterThe error is still there even when i did "......"
You obviously cant see the connection between the posts. Maybe you have a social disorder or something, and if that is the case then i must excuse myself, but if not then you should start taking a better look at the posts before you bomb me with your invalid arguments for no reason.Ohh, and by the way.. I gave up.. Seems like it wasent the right thing for me "........"
Im just a game enthusiast trying to learn new stuff, but obviously you guys dont want me to learn anything.
As for this:
Have you ever tried the new terrain system in ogre? You can input a 61441x61441 pixel height map, and still get a stable fps. (this does not mean that i hate Irrlicht, infact it is one of the best game engines ive ever tried.)by ACE247 » Sat Oct 29, 2011 1:40 pm
'Reason' yeah have fun with OGRE its so abstracted and messy... Well I wont say any more.
Oh, and have i ever said that i dislike Irrlicht?? Because you guys obviously think so.
This is not personal, so no offence. And also i might have som english errors.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Texture Splatting [OpenGL]
Ok, so this is your problem report. At first and second glance there's even no report from you. Only once we learn that you put your report inside the reply from freetimecoder we can get a slight idea about what you mean. Next post tells us that you have many RAM and an unknown gfx card, again with lots of RAM. Guess what might help us more to know instead of the amount of RAM you have...reason wrote:Only problem is:
Thank youby roelor » Tue Jun 08, 2010 12:05 am
this doesnt work well on my intel gma 4500. framerate is low, (thats to be expected) but the terrain is transparant in the distance. (you can look through the terrain).
by freetimecoder » Wed Jun 09, 2010 9:03 am
Hi,
Is it transparent only in the distance or everywhere? Only in the distance. Does it look like on the screenshot, ecxept the transparency? Looks like on the screenshots. What OpenGL/GLSL version do you have? OpenGL 2.1 Does it give any errors in the console? Dont think so.
greetings
So next time you respond to a thread more than a year old you should expect longer turn around times anyway. And with regard to your report, you should be happy with any response. A proper report would contain screenshots, a console log, the whole hardware list that is of interest, and a fully working demo which reproduces the problem. In that case you might decrease your waiting times by orders of magnitude probably. But since this is an external add-on, it may take still a little longer because no one might work with it regularly. And last, it might also help to get familiar with this community first, before demanding any action to be taken. 4 postings is not what we call a power user. So make your credits, fix this add-on and help all osx users out there. Might help you in the future when looking for help
Re: Texture Splatting [OpenGL]
WOAOW!! Problem report? Problematic report...
PS do you have any idea how that terrain works? Didn't think so. I can make the same thing in irrlicht thanks to the magic of guess what? Shaders and proper programming.
PS do you have any idea how that terrain works? Didn't think so. I can make the same thing in irrlicht thanks to the magic of guess what? Shaders and proper programming.
Re: Texture Splatting [OpenGL]
Thing is hybrid.
I may be a noob.
I may be unexperienced.
I may be a nonperfect human being.
but that doesnt give you the right to deprive me the right to ask for help. I never expected him or anyone to reply me.
Just to make it clear.
Thanks for your opinions, but lets make peace guys. Im a n00b trying to learn, so lets just leave it at it.
And also respect hybrid, you are probably extremely skilled compared to me.
I may be a noob.
I may be unexperienced.
I may be a nonperfect human being.
but that doesnt give you the right to deprive me the right to ask for help. I never expected him or anyone to reply me.
Just to make it clear.
This does not mean that i hate Irrlicht!!by reason » Fri Oct 28, 2011 11:49 pm
Ohh, and its been a few days now since i commented. So ive lost interest anyways switching to ogre.
You probably can, and wouldnt doubt it, but i cant and thats why im going to test Ogre, because its easier for ME. Maybe not for you.by ACE247 » Tue Nov 01, 2011 2:40 pm
WOAOW!! Problem report? Problematic report...
PS do you have any idea how that terrain works? Didn't think so. I can make the same thing in irrlicht thanks to the magic of guess what? Shaders and proper programming.
Thanks for your opinions, but lets make peace guys. Im a n00b trying to learn, so lets just leave it at it.
And also respect hybrid, you are probably extremely skilled compared to me.
-
- Posts: 30
- Joined: Tue Oct 18, 2011 3:48 pm
Re: Texture Splatting [OpenGL]
My splatting editor
http://www.youtube.com/watch?v=iKYeCssIgjg
Sorry for low quality
Very thx for your code.
http://www.youtube.com/watch?v=iKYeCssIgjg
Sorry for low quality
Very thx for your code.
Re: Texture Splatting [OpenGL]
Hey nice editor! Almost missed this. What are you using to handle your GUI, QT?
-
- Posts: 30
- Joined: Tue Oct 18, 2011 3:48 pm
Re: Texture Splatting [OpenGL]
I'm using Visual Studio Products.
First I export functions to dll by extern "C" __delspec(dllexport) ...
and later create GUI in Visual Studio C# 2010(I build dll in VS C++ 2010) and import this functions to C#
Working very good.
For keyboard and mouse events first i check event from c# and send to c++ dll like this
Sorry for my bad english (and small off-topic ;p - later i create another topic)
wiedzmin112
First I export functions to dll by extern "C" __delspec(dllexport) ...
and later create GUI in Visual Studio C# 2010(I build dll in VS C++ 2010) and import this functions to C#
Code: Select all
using System.Runtime.InteropServices;
...(namespace main class)...
public partial class Main : Form
{
public const string DLLName = "DarkMap Dynamic Library.dll";
#region PInvoke
[DllImport(@DLLName, CallingConvention = CallingConvention.Cdecl)]
internal static extern void InitEditor(IntPtr window);
[DllImport(@DLLName, CallingConvention = CallingConvention.Cdecl)]
internal static extern void UpdateEditor();
[DllImport(@DLLName, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr GetGrid();
[DllImport(@DLLName, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr GetNodeFromMouse(int type);
[DllImport(@DLLName, CallingConvention = CallingConvention.Cdecl)]
internal static extern void Deselect();
[DllImport(@DLLName, CallingConvention = CallingConvention.Cdecl)]
internal static extern void ResetEditor();
.....
For keyboard and mouse events first i check event from c# and send to c++ dll like this
Code: Select all
private void Main_KeyDown(object sender, KeyEventArgs e)
{
AltDown = e.Alt;
if (e.Alt)
Input.InputKeyDown(256);
else
Input.InputKeyUp(256);
if (e.Control)
Input.InputKeyDown(255);
else
Input.InputKeyUp(255);
Input.InputKeyDown(e.KeyValue);
}
wiedzmin112
Re: Texture Splatting [OpenGL]
Excellent
Do you know if there is a way to remove this line?
Do you know if there is a way to remove this line?
Code: Select all
terrain->setMaterialFlag(video::EMF_LIGHTING,false);
-
- Posts: 38
- Joined: Mon Jan 09, 2012 5:07 pm
Re: Texture Splatting [OpenGL]
Hi, sorry if i bump an old thread, i am not really sure if this is the right place to ask this.
I try to get the terrain splatting code to work with the water from this topic (http://irrlicht.sourceforge.net/forum/v ... =4&t=45627). Unfortunately there are some problems when i try to use both in combination together. There is no shore effect anymore as one can see in the sreenshot below. freetimecoder mentioned that the terrain splatting is not usable for the textures at once for a shader, i guess this is exactly what needs to be changed. The question i have now, is what would be the best way to achieve this?
This is how it looks when its used on a terrain rendered as in example 12:
The first screenshot is from the example where i added the code for the water, you can download the changed example from here:
http://www.mediafire.com/?72595cv8ldgx3a1
Thanks in advance for any advice
I try to get the terrain splatting code to work with the water from this topic (http://irrlicht.sourceforge.net/forum/v ... =4&t=45627). Unfortunately there are some problems when i try to use both in combination together. There is no shore effect anymore as one can see in the sreenshot below. freetimecoder mentioned that the terrain splatting is not usable for the textures at once for a shader, i guess this is exactly what needs to be changed. The question i have now, is what would be the best way to achieve this?
This is how it looks when its used on a terrain rendered as in example 12:
The first screenshot is from the example where i added the code for the water, you can download the changed example from here:
http://www.mediafire.com/?72595cv8ldgx3a1
Thanks in advance for any advice
-
- Posts: 48
- Joined: Sun Apr 22, 2012 11:55 pm
- Location: Vienna
- Contact:
Re: Texture Splatting [OpenGL]
I really like that code, but I've got some questions.
Does this line of code actually do anything?
Alpha-Texture:
Actually the fragment shader output of the second pass should be blended with the color value already stored in the framebuffer, but instead it is blended with 0. I don't understand what is causing this.
Edit:
I guess it's an Irrlicht bug?
If I use the following code, everything works right:
I tried to change the pack_textureBlendFunc values to EBF_SRC_ALPHA and EBF_ONE_MINUS_SRC_ALPHA, but that resulted in black borders again. Here is a screenshot of my "bruteforce"-method:
Edit2:
Actually I just found out that MaterialTypeParam is used by COpenGLMaterialRenderer_TRANSPARENT_ALPHA_CHANNEL for alpha testing.
But there is definitly something wrong as it renders perfectly when enabling blending just before or right after COpenGLMaterialRenderer_TRANSPARENT_ALPHA_CHANNEL::OnSetMaterial() is called, which is pretty strange because this method enables blending too.
Does this line of code actually do anything?
Additionally, I always get black edges when using the alpha channel:freetimecoder wrote:Code: Select all
material.MaterialTypeParam =pack_texureBlendFunc(video::EBF_DST_COLOR,video::EBF_ONE);
Alpha-Texture:
Actually the fragment shader output of the second pass should be blended with the color value already stored in the framebuffer, but instead it is blended with 0. I don't understand what is causing this.
Edit:
I guess it's an Irrlicht bug?
If I use the following code, everything works right:
Code: Select all
driver->setMaterial(material);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
driver->drawMeshBuffer(((scene::ITerrainSceneNode*)array_Nodes[i].Node)->getRenderBuffer());
glDisable(GL_BLEND);
Edit2:
Actually I just found out that MaterialTypeParam is used by COpenGLMaterialRenderer_TRANSPARENT_ALPHA_CHANNEL for alpha testing.
Code: Select all
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, material.MaterialTypeParam);
-
- Posts: 48
- Joined: Sun Apr 22, 2012 11:55 pm
- Location: Vienna
- Contact:
Re: Texture Splatting [OpenGL]
Did anybody have a look on this yet?
Edit:
I just took another look on the Irrlicht files and found out that this blending operations do not work with EMT_TRANSPARENT_ALPHA_CHANNEL but only with EMT_ONETEXTURE_BLEND, so in the constructor you need to fix this:
The default blending operation is EBO_MIN, so we have to set it to EBO_ADD and set src and dst to EBF_SRC_ALPHA and EBF_ONE_MINUS_SRC_ALPHA respectively to get the desired result:
Here is the result:
Edit:
I just took another look on the Irrlicht files and found out that this blending operations do not work with EMT_TRANSPARENT_ALPHA_CHANNEL but only with EMT_ONETEXTURE_BLEND, so in the constructor you need to fix this:
Code: Select all
//Create the shader material
shaderMaterial = driver->getGPUProgrammingServices()->addHighLevelShaderMaterial(
vertShader, "main", video::EVST_VS_1_1,
fragShader, "main", video::EPST_PS_1_1,
this, video::EMT_ONETEXTURE_BLEND);
Code: Select all
if(array_Nodes[i].Node->getType()==scene::ESNT_TERRAIN){
video::SMaterial material = array_Nodes[i].Node->getMaterial(0);
material.MaterialType = (video::E_MATERIAL_TYPE)shaderMaterial;
material.BlendOperation = video::EBO_ADD;
material.MaterialTypeParam = pack_textureBlendFunc(video::EBF_SRC_ALPHA ,video::EBF_ONE_MINUS_SRC_ALPHA);
driver->setMaterial(material);
driver->drawMeshBuffer(((scene::ITerrainSceneNode*)array_Nodes[i].Node)->getRenderBuffer());
}