Crystal Space
Welcome, Guest. Please login or register.
October 23, 2017, 07:52:59 pm

Login with username, password and session length
Search:     Advanced search
9063 Posts in 2051 Topics by 77877 Members
Latest Member: Ginnypancra268
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  Texture Display and/or Compression Question
« previous next »
Pages: [1] Print
Author Topic: Texture Display and/or Compression Question  (Read 2885 times)
Posts: 30

View Profile Email
« on: August 10, 2009, 08:53:11 pm »

Version of CS – CS stable 1.2.1
Version of CEL – CEL stable 1.2.1
Version of winlibs package (if on windows) – Corresponding 1.2_002
Operating system – Windows XP
Compiler – MSVC++ 2005
Video card – ATI Radeon X1650 PRO
Driver – Version

Hello, knowledgeable and insightful crystallized people.

I'll cut right to the chase:
Problem: I cannot figure out how to display csSimplePixmaps as uncompressed textures (based on the HOWTO::Loading Images for Pixmaps).
Reasons: I want to create a background image (back behind the 3D meshes) that is high quality and compressed images are just too poor in display quality.

My first choice was to use CEL's billboard system which worked great at first because that can all be done in map files and use textures directly from map files with the XML flag <class>nocompress</class> working conveniently. To my dismay, it seems that billboards render after meshes meaning that they overlap the mesh, thus hiding them, and I could not find any way to allow meshes to be displayed in front of the billboard.
My second option was to revert back to CS's SimplePixmaps, as I have tested these out and know that when I code
"pixmap_->DrawScaled(g3d_, 1, 1, g2d->GetWidth(), g2d->GetHeight());" within the ProcessFame(), after "g3d_->BeginDraw(...);" and before "view_->Draw();" the images displays as a background image (in the background; behind the meshes). But, I cannot find a way to have that image look better i.e. leave the texture uncompressed. Also, I am weary of this method because, with it, I cannot use CEL's camera system and I fear that will complicate matters using CEL.
I assure you that I’ve been up and down the manual, all over the API, going on 5 days of trial and error over this for a number of hours each day before my mind goes numb trying to solve this problem. No worries about that…I’ve spent weeks mind numbingly trying to solve ridiculous bugs like …over indexing arrays… I did find some things in the API such as setting a ‘Texture Class’ to the iTextureHandle, but I think that is beyond the scope of my knowledge.

Danke. Gracias. Thanks.

UPDATE: SimplePixmap texture compression question answered: give an argument i.e.  ‘nocompress’, ‘normalmap’, or ‘lookup,’ to iTextureHandle::SetTextureClass(const char*). How did I not get that before? I’d better stop posting before I do something stupid again, heh.
« Last Edit: August 14, 2009, 01:41:31 am by Crystalfur » Logged
Full Member
Posts: 191

View Profile WWW
« Reply #1 on: August 11, 2009, 03:23:17 pm »

I think simple pixmaps are 2D operations only, so it would almost always draw on top of 3D stuff.
One way to do that, would be to create a 3D mesh/plane with "camera" flag,
so it's always drawn at constant distance of the camera (like skyboxes, but possibly position-adjusted every frame),
and apply a material created from a texture which has the "nocompress" tex class.
Posts: 30

View Profile Email
« Reply #2 on: August 12, 2009, 05:17:42 am »

Hey Vincent, thanks for taking the time to reply.

I took your advice and went with the, shall we say, 'primitive' way of getting a background image by just putting the image on a mesh and fitting the mesh to the size of the screen. I've spent so long trying to figure out a way to do it without using a mesh that I am happy getting something that works and I'm taking what I can get. The image quality is still not quite as good as a billboard, but it is good enough.

I don't mean this as a put-down, but I am a surprised CS has no standard means of displaying background images. I would have thought that this would be a desirable feature in platformer or side-scroller type of game.

In any case, I have no need (for now) of keeping the mesh at a constant distance away from the camera because the camera is stationary. I'm not sure if you see what I am trying to accomplish. Think about it like this: hypothetically, you take a picture of the inside of a room and set that picture as the background. You want to have a character move about the room (which is just a 2D picture) so the character has to be in the foreground. The problem in using a mesh with a material containing the image is that it has to be set far enough back that the character you're moving around the room does not collide with it, then, size it to fill the screen. Setting and resizing the background image mesh isn't that much trouble, but it's not the most straightfoward means.

Note: Probably something done wrong on my part, but when I added the <camera /> flag to the <meshobj> my mesh disappeared. Not a big deal since I am not using the flag.
« Last Edit: August 12, 2009, 05:20:40 am by Crystalfur » Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 6.187 seconds with 15 queries.