Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (TedMar, VoroneTZ, vicknick), 825 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Assigning materials to level blocks [SOLVED] #443283
07/12/14 17:18
07/12/14 17:18
Joined: Mar 2010
Posts: 120
Switzerland
T
TehV Offline OP
Member
TehV  Offline OP
Member
T

Joined: Mar 2010
Posts: 120
Switzerland
I'm attempting to apply a specular bumpmapping shader to a level block (inserted by right click -> Add -> Cube -> Small). I am assigning a texture to it as well, by the name 'stonemarble'. To do this, I'm setting its material to marble_tile from within WED, like so:




Then, in the main code, I defined this material as follows:
Code:
//Materials & Shaders

BMAP* marble_texture = "textures\\stonemarble.bmp";
BMAP* marble_bump = "textures\\stonemarblebump.bmp";

MATERIAL* marble_tile = {
	skin1 = marble_texture;
	skin2 = marble_bump;
	effect = "specBump.fx";
}



When I start the game, I get a warning saying "STONEMARBLE: Normal or height map missing".

Does anyone know why this might be happening?

Last edited by TehV; 07/14/14 22:08.
Re: Assigning materials to level blocks [Re: TehV] #443284
07/12/14 17:37
07/12/14 17:37
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Quote:

I am assigning a texture to it as well, by the name 'stonemarble'. To do this, I'm setting its material to marble_tile from within WED,


Make sure you've imported your WAD file, and double click the texture from the WAD file, while your block is selected to apply a texture.

Textures and Materials are two different things.

Perhaps you want to follow my WED tutorial laugh


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Assigning materials to level blocks [Re: DLively] #443285
07/12/14 18:03
07/12/14 18:03
Joined: Mar 2010
Posts: 120
Switzerland
T
TehV Offline OP
Member
TehV  Offline OP
Member
T

Joined: Mar 2010
Posts: 120
Switzerland
Originally Posted By: DLively
Quote:

I am assigning a texture to it as well, by the name 'stonemarble'. To do this, I'm setting its material to marble_tile from within WED,


Make sure you've imported your WAD file, and double click the texture from the WAD file, while your block is selected to apply a texture.

Textures and Materials are two different things.

Perhaps you want to follow my WED tutorial laugh


I'm already doing this. That's how I assigned the texture.

Perhaps my code was slightly misleading in that regard. I've assigned the same texture to the material because I assumed it would fix the problem I was having - which it didn't.

Re: Assigning materials to level blocks [Re: TehV] #443291
07/12/14 19:04
07/12/14 19:04
Joined: May 2014
Posts: 179
The lit part of the Truth
C
CyberGhost Offline
Member
CyberGhost  Offline
Member
C

Joined: May 2014
Posts: 179
The lit part of the Truth
I think you should assign normalmap for the texture since you assigned a material and shader effect.


Nothing to say ....
Re: Assigning materials to level blocks [Re: CyberGhost] #443305
07/13/14 00:15
07/13/14 00:15
Joined: Mar 2003
Posts: 1,524
Canada
Stansmedia Offline
Serious User
Stansmedia  Offline
Serious User

Joined: Mar 2003
Posts: 1,524
Canada
In your main function set this:
Code:
d3d_automaterial=1;



In your wad add your texture, ex.. stonemarble. Add your bump map texture to your wad file as this: stonemarble_n. Remember the alpha map of your normal map texture is used as the specular map.

Before your main function add this:

Code:
MATERIAL* stonemarble=
{
	specular_blue = 255;
	specular_green = 255;
	specular_red = 255;
	diffuse_red = 255;
	diffuse_blue = 255;
	diffuse_green = 255;
	specular_blue = 255;
	ambient_red = 0;
	ambient_blue = 0;
	ambient_green = 0;
	albedo = 200;
	power = 10;
	effect = "specBump.fx";
	flags = PASS_SOLID;
}



With d3d_automaterial, all your wed block textures will have the material with the same name applied to it. Make sure the wad file contains the normal map with the same name as the texture ending in _n.

edit:

Quote:
When I start the game, I get a warning saying "STONEMARBLE: Normal or height map missing".


Your normal map texture is a BMP. BMP files do not support alpha maps. The engine is probably looking for the specular map in the alpha channel and not finding it. TGA or DDS files can save with alpha channels.

One thing to keep in mind if your trying to use other shaders with wad textures is that the normal map textures ending in _n are placed in the entskin3 slot by the engine, not entskin2 like most shaders require.

Last edited by Stansmedia; 07/13/14 00:19.

Decessus - 80% done. 100% abandoned.
GET MY ANDROID GAME! https://play.google.com/store/apps/details?id=com.lasertrain.zspinballfree&hl=en
Re: Assigning materials to level blocks [Re: Stansmedia] #443383
07/14/14 22:10
07/14/14 22:10
Joined: Mar 2010
Posts: 120
Switzerland
T
TehV Offline OP
Member
TehV  Offline OP
Member
T

Joined: Mar 2010
Posts: 120
Switzerland
Originally Posted By: Stansmedia
In your wad add your texture, ex.. stonemarble. Add your bump map texture to your wad file as this: stonemarble_n. Remember the alpha map of your normal map texture is used as the specular map.


That was the problem. I didn't have my bump map in the wad, and attempted to assign it via script. Thanks!


Moderated by  HeelX, rvL_eXile 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1