Page 1 of 1

Fuzzy GUI picture/colorkey?

Posted: Mon Nov 01, 2004 2:38 pm
by Guest
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
Image

what it should look like
Image

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 8)

Posted: Mon Nov 01, 2004 5:29 pm
by Robomaniac
Just to let you know

Personal should be Personnel :)

I had the same problems w/ OpenGL too, i think its an internal implementation problem

Posted: Mon Nov 01, 2004 7:49 pm
by Guest
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.

Posted: Mon Nov 01, 2004 11:37 pm
by Guest
WTF IS THAT ??? if i disable anisotropic filtering the whole text gets totally blurry and no human beeing could read that stuff!! if i set anisotropic filtering to 8x mode, it looks perfectly! common there must be a way to solve this, or do i really have to buy microsofts visual studio for this???

Posted: Tue Nov 02, 2004 9:15 am
by bal
Can't you load it as seperate images (top part and bottom part)? This would also make it resolution-independant...

Posted: Tue Nov 02, 2004 10:03 am
by Tyn
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

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(); 
} 

Posted: Sat Nov 20, 2004 1:24 pm
by Guest
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

Posted: Sun Nov 21, 2004 12:28 am
by dingo
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