Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AbrahamR, wdlmaster, 7th_zorro, dr_panther, 1 invisible), 764 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 4 of 5 1 2 3 4 5
Re: Projective Texture Mapping - Spotlight Flashl [Re: Scorpion] #181163
02/20/08 04:00
02/20/08 04:00
Joined: Jun 2005
Posts: 656
G
Grafton Offline OP
User
Grafton  Offline OP
User
G

Joined: Jun 2005
Posts: 656
Quote:

what would be a good addition for realistic purpose:

get the dot product of the model normal and the normal from vertex to cam position and then use it with the "alpha" of the projection. So that only faces facing the light get lighted.




The shaders provided already do this. Only forward (light source) facing
polygons are lit.

Adding more dynamic lights is simple, but many lights will require more than
one pass which would slow the shaders down. Plus, if you wanted all lights to
cast shadows, you will need a very high end graphics card.

The game I created the flashlight shaders for features a shader that also
supports a dynamic light that casts shadows (a "horror house" dynamic strobe
light). I used light mapping for all else.

You could create a shader which supports 2 projections without shadows and 3
lights with shadows or whatever you wish. There are numerous combinations you
can create. Hopefully the examples should get you started.


Re: Projective Texture Mapping - Spotlight Flashl [Re: Grafton] #181164
02/20/08 04:37
02/20/08 04:37
Joined: Jun 2005
Posts: 656
G
Grafton Offline OP
User
Grafton  Offline OP
User
G

Joined: Jun 2005
Posts: 656
About the troubles in conversions. The simple per pixel spotlight shader setup
can easily be converted to c-script. However, shadow mapping and projective
texturing both rely on the use of a material assigned to a view. As far as I
know, this is currently only availible when using lite-c.


Not two, not one.
Re: Projective Texture Mapping - Spotlight Flashl [Re: Helghast] #181165
02/20/08 11:38
02/20/08 11:38
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Quote:

in the meantime im wondering, how can i change the colour of the shadow pixel?




anybody, i really wanna know this!!

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Projective Texture Mapping - Spotlight Flashl [Re: Helghast] #181166
02/24/08 13:55
02/24/08 13:55
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
hi, great contribution from you grafton, thanks.

check your pm's



Ubi bene, ibi Patria.
Re: Projective Texture Mapping - transfer2texture? [Re: Grafton] #181167
03/17/08 14:13
03/17/08 14:13
Joined: Jul 2005
Posts: 27
A
andibeh Offline
Newbie
andibeh  Offline
Newbie
A

Joined: Jul 2005
Posts: 27
Maybe it is a super stupid question, but would it be possible to transfer the projected texture permanently to the texture of the hit model?
I would need that for a scientific simulation where I need to "print" several copies of a texture onto a model.

Last edited by andibeh; 03/17/08 14:14.
Re: Projective Texture Mapping - transfer2texture? [Re: andibeh] #181168
03/18/08 12:26
03/18/08 12:26
Joined: Oct 2006
Posts: 873
S
Shadow969 Offline
User
Shadow969  Offline
User
S

Joined: Oct 2006
Posts: 873
yeah, i wonder about this too, to make some kind of shadowmapping

Re: Projective Texture Mapping - transfer2texture? [Re: Shadow969] #203717
04/23/08 16:35
04/23/08 16:35
Joined: Jul 2007
Posts: 619
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 619
Turkey, Izmir
Hey,did anyone convert "PT EXAMPLES" to c-script? (example 5-6-7-8)
Child flags(view.material&view.stage) not working with c-script.
How can i use "projective texture" with c-script. Is this impossible?
Sorry for my bad speak english.

Re: Projective Texture Mapping - transfer2texture? [Re: Emre] #205017
05/02/08 23:46
05/02/08 23:46
Joined: May 2008
Posts: 3
S
Satori Offline
Guest
Satori  Offline
Guest
S

Joined: May 2008
Posts: 3
How can i use this material for normal bsp map blocks ? It works only on entities \:\(

Re: Projective Texture Mapping - transfer2texture? [Re: Satori] #206154
05/11/08 16:36
05/11/08 16:36
Joined: Apr 2007
Posts: 249
Louisana, USA
Ilidrake Offline
Member
Ilidrake  Offline
Member

Joined: Apr 2007
Posts: 249
Louisana, USA
While using the code I noticed it only handles side to side movement. Not very effective for use as a flashlight. Anyway to make it where it follows where the player is looking, side to side, up and down.


Just Because Your Paranoid Doesn't Mean They Aren't After You...Because They Really Are

http://spearbang.awardspace.com/news.php
Re: Projective Texture Mapping [Re: Ilidrake] #206158
05/11/08 17:17
05/11/08 17:17
Joined: Jun 2005
Posts: 656
G
Grafton Offline OP
User
Grafton  Offline OP
User
G

Joined: Jun 2005
Posts: 656
I am not sure what you mean. In the demos, use the left/right cursor keys to
pan the spotlight and the up/down cursor keys to tilt the spotlight. The W/S
keys move it forwards and backwards. It can be positioned anywhere pointing in
any direction.

The purpose of these demos is to present the shaders to create spotlights,
flashlights and projective texturing with/without shadow and normal mapping
for general purposes. For a specific use, you will need to supply your own
movement/placement code.

For instance, if you want to make a flashlight that follows your camera, then
each frame you need to do something like this;

vec_set(temp_vec, vector(10,-10,-10)); // create a vector
vec_rotate (temp_vec, camera.pan); // rotate the vector to the cameras pan
vec_add (temp_vec, camera.x); // position the vector at the camera
vec_set(flashlight_mdl.x, temp_vec); // position your flashlight model
vec_set(flashlight_mdl.pan, camera.pan);

Then send the position of the flashlight model to your shader.


Not two, not one.
Page 4 of 5 1 2 3 4 5

Moderated by  adoado, checkbutton, mk_1, Perro 

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