Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 16,221 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 5 1 2 3 4 5
Re: My first shader is not working [Re: TrackingKeks] #323969
05/18/10 18:50
05/18/10 18:50
Joined: Apr 2010
Posts: 56
Badrizmo Offline OP
Junior Member
Badrizmo  Offline OP
Junior Member

Joined: Apr 2010
Posts: 56
Originally Posted By: TrackingKeks
Try to use the shader with an entity or attach it in the script:

my.material=Ambient;


Finally I was able to make it work with entities by attaching it in the script or through the WED (both works now) But it still don't work with blocks.

Lite-C code
Click to reveal..

#include <acknex.h>
#include <default.c>



MATERIAL* MtlAmbient=
{
ambient_red = 250; // The ambient color.
ambient_green = 64;
ambient_blue = 64;
effect = "ambient.fx";
}

MATERIAL ShadedAmb = MtlAmbient; /*This line was a must for the material to appear in the WEB materials list*/

function main()
{
level_load("shop.wmb");
wait(2);
}

action shadedEntity()
{
my.material = MtlAmbient;
}


ambient.fx
Click to reveal..

/***********************************************************************************************
/ Copyright 2006 by Taco Cohen. All rights reserved
/***********************************************************************************************/

/***********************************************************************************************
/ Ambient Lighting Shader
/
/ OUTLINE:
/ This shader draws the object in a solid color given by the materials ambient color.
/
/ IMPLEMENTATION:
/ The vertex shader transforms the vertex to clip space. The pixel shader multiplies the
/ ambient color by the ambient intensity and returns that as the final pixel color.
/
/ NOTES:
/ -
/***********************************************************************************************/

/***********************************************************************************************
/ Global Variables:
/***********************************************************************************************/
// Tweakables:
static const float AmbientIntensity = 1.0f; // The intensity of the ambient light.

// Application fed data:
const float4x4 matWorldViewProj; // World*view*projection matrix.
const float4 vecAmbient; // Ambient color, passed by the engine.


/***********************************************************************************************
/ Vertex Shader:
/***********************************************************************************************/
void AmbientVS( in float4 InPos : POSITION,
out float4 OutPos : POSITION)
{
// Transform the vertex from object space to clip space:
OutPos = mul(InPos, matWorldViewProj);
}

/***********************************************************************************************
/ Pixel Shader:
/***********************************************************************************************/
float4 AmbientPS() : COLOR
{
return AmbientIntensity * vecAmbient;
}

/***********************************************************************************************
/ Technique:
/***********************************************************************************************/
technique AmbientTechnique
{
pass P0
{
VertexShader = compile vs_1_1 AmbientVS();
PixelShader = compile ps_1_1 AmbientPS();
}
}


Beside the fact that this didn't work with Blocks (which I'm using for walls) I have a concern here

The Material definition never appeared in the materials list in the WED
MATERIAL* MtlAmbient=
{
ambient_red = 250; // The ambient color.
ambient_green = 64;
ambient_blue = 64;
effect = "ambient.fx";
}
To solve this problem I added the following line
MATERIAL ShadedAmb = MtlAmbient;

Now one thing at a time, I just need to konw why it didn't work with blocks and did work with entities, does this has any relation to the version which I'm using

Re: My first shader is not working [Re: Badrizmo] #323971
05/18/10 18:57
05/18/10 18:57
Joined: Nov 2008
Posts: 196
the wrong place
Muhsin Offline
Member
Muhsin  Offline
Member

Joined: Nov 2008
Posts: 196
the wrong place
let's be honest.. where did you get you gamestudio from?


Come and play my new browsergame - Valley Of Wolves:

http://www.mafiacreator.com/ValleyOfWolves

Hurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it!
And be the most feared MafiaBoss in the World!!
Re: My first shader is not working [Re: Muhsin] #323976
05/18/10 19:21
05/18/10 19:21
Joined: Apr 2005
Posts: 3,076
Germany, NRW
rvL_eXile Offline

3D Artist
rvL_eXile  Offline

3D Artist

Joined: Apr 2005
Posts: 3,076
Germany, NRW
Please create a Screenshot of your Gamestudio Version (Help->About (Take Screen / Upload / show)...

cYa Sebastian


Tutorials:
[Blender]Terrain creation ENG/GER
[Blender]Low Poly Tree Modeling
[GIMP]Create a Texture for Terrains
CLICK HERE


Re: My first shader is not working [Re: rvL_eXile] #323983
05/18/10 20:16
05/18/10 20:16
Joined: Nov 2008
Posts: 196
the wrong place
Muhsin Offline
Member
Muhsin  Offline
Member

Joined: Nov 2008
Posts: 196
the wrong place
why did you make me a warez kiddy?


Come and play my new browsergame - Valley Of Wolves:

http://www.mafiacreator.com/ValleyOfWolves

Hurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it!
And be the most feared MafiaBoss in the World!!
Re: My first shader is not working [Re: rvL_eXile] #323986
05/18/10 20:42
05/18/10 20:42
Joined: Apr 2010
Posts: 56
Badrizmo Offline OP
Junior Member
Badrizmo  Offline OP
Junior Member

Joined: Apr 2010
Posts: 56
Originally Posted By: rvL_eXile
Please create a Screenshot of your Gamestudio Version (Help->About (Take Screen / Upload / show)...

cYa Sebastian


Here you go,


Re: My first shader is not working [Re: Badrizmo] #323988
05/18/10 20:56
05/18/10 20:56
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
ROFL, great job Sebastian tongue You got the wrong one wink

Badrizmo, please stop that crap, we aren´t as stupid as you seem to be. I mean, buy it or stick to the cracked pro or the test version. Buying gives you everything you want, the cracked pro won´t make you happy due to many bugs and the trial doesn´t support shaders.

Edit: I meant the free version of course, as the trial does support shaders.

Last edited by Slin; 05/18/10 21:31.
Re: My first shader is not working [Re: Slin] #323989
05/18/10 21:03
05/18/10 21:03
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Awesome. Just awesome... Must... make... screenshot...


Always learn from history, to be sure you make the same mistakes again...
Re: My first shader is not working [Re: Uhrwerk] #323990
05/18/10 21:05
05/18/10 21:05
Joined: Nov 2008
Posts: 196
the wrong place
Muhsin Offline
Member
Muhsin  Offline
Member

Joined: Nov 2008
Posts: 196
the wrong place
noooooo! no photo, no photo! grin


Come and play my new browsergame - Valley Of Wolves:

http://www.mafiacreator.com/ValleyOfWolves

Hurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it!
And be the most feared MafiaBoss in the World!!
Re: My first shader is not working [Re: Slin] #323992
05/18/10 21:18
05/18/10 21:18
Joined: Apr 2010
Posts: 56
Badrizmo Offline OP
Junior Member
Badrizmo  Offline OP
Junior Member

Joined: Apr 2010
Posts: 56
Originally Posted By: Slin
ROFL, great job Sebastian tongue You got the wrong one wink

Badrizmo, please stop that crap, we aren´t as stupid as you seem to be. I mean, buy it or stick to the cracked pro or the test version. Buying gives you everything you want, the cracked pro won´t make you happy due to many bugs and the trial doesn´t support shaders.


I'm planning to buy it ( I hate piracy as I used to be a software engineer ), but as far as I know paypal is not supported in my region. So I need to find other ways for the payment.

Concerning that the test version doesn't suppot shaders, I was able to apply the shader on an entity how could you explain that? I'm not making useless arguments here I just need to utilize the 30 days trial as much as I can in order to make the maximum benefit from my purchased version

Re: My first shader is not working [Re: Uhrwerk] #323993
05/18/10 21:20
05/18/10 21:20
Joined: Apr 2010
Posts: 56
Badrizmo Offline OP
Junior Member
Badrizmo  Offline OP
Junior Member

Joined: Apr 2010
Posts: 56
Originally Posted By: Uhrwerk
Awesome. Just awesome... Must... make... screenshot...


yea, I believe this is true screenshot helped all of us here at least we were able to identify the problem

Page 3 of 5 1 2 3 4 5

Moderated by  Blink, Hummel, Superku 

Gamestudio download | 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