i have 2 problems:
1. the gui picture that i made looks fuzzy in irrlicht (iam using opengl mode), any suggestions how to fix this? ive read much about it but not how to fix this problem.
2. how can i make some sort of makeColorKey for gui images? it seems that they dont have something like this.
i uploaded 2 pictures showing the 2 problems:
problem
what it should look like
i hope you can help me
edit: the gui isnt final, elements are missing, the colors are too hard and some sentences are wrong because iam german, and its a little big, but i already have another gui, but i dont know which one i should use, they both arent looking so bad
Fuzzy GUI picture/colorkey?
-
- Posts: 602
- Joined: Sat Aug 23, 2003 2:03 am
- Location: Pottstown, PA
- Contact:
ok i changed the "personal" thing to personnel
and i even got the UI to work ( i had to cut it into 3 pieces and then set them separately as GUI image, otherwise it wont work for me, but its looking good)
maybe i should use addStaticText for the text lines instead of painting them on the GUI picture? because then it wouldnt be blurry and i could may change it faster if i wanted to just a thought.
and i even got the UI to work ( i had to cut it into 3 pieces and then set them separately as GUI image, otherwise it wont work for me, but its looking good)
maybe i should use addStaticText for the text lines instead of painting them on the GUI picture? because then it wouldnt be blurry and i could may change it faster if i wanted to just a thought.
Using IGUIImage by any chance? Had same problem, for some unknown reason it doesn't support alphablending. Try the patch here, it is what I am using the following changes to the engine ( fix by zola ):
IGUIImage.h
--------------------------------------------------------------------------------
CGUIImage.cpp
IGUIImage.h
Code: Select all
// Copyright (C) 2002-2004 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in Irrlicht.h
#ifndef __I_GUI_IMAGE_H_INCLUDED__
#define __I_GUI_IMAGE_H_INCLUDED__
#include "IGUIElement.h"
#include "ITexture.h"
#include "SColor.h"
namespace irr
{
namespace gui
{
//! GUI element displaying an image.
class IGUIImage : public IGUIElement
{
protected:
bool alphablend;
video::SColor image_color;
public:
//! constructor
IGUIImage(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(environment, parent, id, rectangle)
{
image_color=video::SColor(255,255,255,255);
alphablend=false;
}
//! destructor
~IGUIImage() {};
//! sets an image
virtual void setImage(video::ITexture* image) = 0;
// set alphablending for the gui image
virtual void setAlphaBlend(bool enable)
{
alphablend=enable;
}
// set color for the gui image
virtual void setColor(const video::SColor& c)
{
image_color=c;
}
};
} // end namespace gui
} // end namespace irr
#endif
--------------------------------------------------------------------------------
CGUIImage.cpp
Code: Select all
//! draws the element and its children
void CGUIImage::draw()
{
if (!IsVisible)
return;
IGUISkin* skin = Environment->getSkin();
irr::video::IVideoDriver* driver = Environment->getVideoDriver();
core::rect<s32> rect = AbsoluteRect;
if (Texture)
{
driver->draw2DImage(Texture, AbsoluteRect.UpperLeftCorner,
core::rect<s32>(core::position2d<s32>(0,0), Texture->getOriginalSize()),
&AbsoluteClippingRect, image_color,alphablend);
}
else
{
// maybe this would also be a good idea then
// driver->draw2DRectangle(image_color, AbsoluteRect, &AbsoluteClippingRect);
driver->draw2DRectangle(skin->getColor(EGDC_3D_DARK_SHADOW), AbsoluteRect, &AbsoluteClippingRect);
}
IGUIElement::draw();
}
im not sure which method you used for your HUD, but personally i used draw2dimage.
this is fuzzy(blurred) in opnegl(but fine in software) by default, but easily solved but disabling mipmapping on the HUD texture(frankly not a problem since mipmapping is of little interest to such a display).
hmm maybe i should register with this forum...
will do i guess, but since ive already typed this, ill just sign.
Gwalahad
this is fuzzy(blurred) in opnegl(but fine in software) by default, but easily solved but disabling mipmapping on the HUD texture(frankly not a problem since mipmapping is of little interest to such a display).
hmm maybe i should register with this forum...
will do i guess, but since ive already typed this, ill just sign.
Gwalahad
I think it has to do with the fact OGL is mipmapping the HUD. Turn off mipmapping and see if that fixes it. Also maybe draw the HUD is 2D and use a scissor test to apply it to the scene.
Also make sure your HUD is 1:1 for each pixel in the framebuffer. (or use an resolution independent solution)
Ansioscopic filtering works because it is sharpening up the fuzzy mip mapped image.
I think there are also plenty of threads here if you search on the topic "logo" or something similar
Also make sure your HUD is 1:1 for each pixel in the framebuffer. (or use an resolution independent solution)
Ansioscopic filtering works because it is sharpening up the fuzzy mip mapped image.
I think there are also plenty of threads here if you search on the topic "logo" or something similar
-= Want your C code to control real life robots? www.users.on.net/~symes =-