Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/19/24 18:45
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
4 registered members (AndrewAMD, 7th_zorro, TedMar, Ayumi), 800 guests, and 2 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 2 of 5 1 2 3 4 5
Re: Projective Texture Mapping - Spotlight Flashlight [Re: Nidhogg] #181143
02/01/08 05:50
02/01/08 05:50
Joined: Aug 2005
Posts: 390
Florida
O
oldschoolj Offline
Senior Member
oldschoolj  Offline
Senior Member
O

Joined: Aug 2005
Posts: 390
Florida
wow, because of you I now have projectors for my spell casting. You have helped me solve a long time problem, and saved me a good amount of money.

Thankyou.


you can find me with my face in the keyboard, unshaven, listening to some nameless techno tragedy, and hashing through code over a cold cup a stale joe. __________________________________ yours truly
Re: Projective Texture Mapping - Spotlight Flashlight [Re: oldschoolj] #181144
02/01/08 09:31
02/01/08 09:31
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
You are our hero!
I´ll send you some screens.


no science involved
Re: Projective Texture Mapping - Spotlight Flashl [Re: fogman] #181145
02/01/08 12:52
02/01/08 12:52
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
this is great!
question though... the projection works great and all, no probs there, but shadows dont seem to be working on this pc (work computer) though on my laptop (which specs are WAAAAAAAAAAAAY lower) it runs fine, any idea why they dont show up ?

(im using example 7. PT Spotlight with Shadow Mapping)

specs (of both machines) are:

Work PC:
win XP SP2
intel core 2 extreme (quadcore) 3.0 GHZ
4 gig Ram
ATI radeon 8800GTX 768MB

Laptop
win XP SP2
dual core (not a core 2 duo) 1.7 GHZ
1 gig Ram
ATI x1600 256MB

as you can see, both should work fine, i wouldnt have been surprised if thee laptop wouldnt work, but the monster-pc doesnt work... that's weird!

got any idea how to fix this (might be the 1024x1024 render target? how do we make that smaller if needed, so it's 24bit instead of 32bit).

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Projective Texture Mapping - Spotlight Flashl [Re: Emre] #181146
02/01/08 19:46
02/01/08 19:46
Joined: Jun 2005
Posts: 656
G
Grafton Offline OP
User
Grafton  Offline OP
User
G

Joined: Jun 2005
Posts: 656
I made a mistake, when looking at the version of A7 I using, I looked at about
in SED 7.06, instead of WED 7.07. Sorry about the confusion.

Ello:
This is the same as in the demo, except a few shaders were mistakenly set to be
compiled as VS 2.0 instead of 1.1.

Emre:
If you can not use Lite-c's "matViewProj", you can create this yourself like this.
Code:
  
//REPLACE THIS LINE
mat_set(mtlSpotlit.matrix,matViewProj); // store the transformation matrix to the material

//WITH THIS CODE
float my_matVP[16] = { 0.0, 0.0, 0.0, 0.0, 0.0,0.0,0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
mat_set(my_matVP,matView);
mat_multiply(my_matVP,matProj);
mat_set(mtlSpotlit.matrix,my_matVP);



Otherwise, it would be very hard to write this in C-Script (I know I said you
could), because c-script dosent support materials for views.

Helghast:
Yeah that is strange! To try a smaller resolution shadowmap, just change
bmap = "#1024x1024x14"; to
bmap = "#512x512x14"; or
bmap = "#256x256x14";

Re: Projective Texture Mapping - Spotlight Flashl [Re: Grafton] #181147
02/01/08 20:24
02/01/08 20:24
Joined: May 2007
Posts: 7
R
Reigel_Seven Offline
Newbie
Reigel_Seven  Offline
Newbie
R

Joined: May 2007
Posts: 7
Grafton, this is so freaking awesome of you! THANKS!
I was able to convert the pixel shader examples to C-Script format, but I can't figure out a couple of things with the projection shader ones.

Could anyone help me convert this code to C-Script (wdl)? I've done most of it but I'm not sure how to change these lines:

function mtlProjection_event() // adjust matrices to size of bitmaps and pass to "matMtl" and "matEffect"
{
// create a transformation matrix
float pTexAdj[16] = { 0.5, 0.0, 0.0, 0.0, 0.0,-0.5, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 };
// Adjust projection matrix for texture size
pTexAdj[12] = 0.5 + (0.5/(float)bmap_width(projectiontex));// store bitmap diminsions into matrix
pTexAdj[13] = 0.5 + (0.5/(float)bmap_height(projectiontex));
// Store the transformation matrix to the materials then adjust the matrix with the bitmap size
mat_set(mtlSpotlit.matrix,matViewProj); // store the transformation matrix to the material
mat_multiply(mtlSpotlit.matrix,pTexAdj); // adjust the matrix with the bitmap size
}

.......

function init_stages()
{
ProjectionView.stage = camera; // so projection is not lagging one frame behind
}

.......

As far as I can tell, these lines are the only thing that needs to be changed. I don't really know much about shader programming, otherwise I'd be able to do it myself. If someone could help me I'd be extremely grateful.

Thanks in advance!

Re: Projective Texture Mapping - Spotlight Flashl [Re: Reigel_Seven] #181148
02/02/08 04:45
02/02/08 04:45
Joined: Jul 2007
Posts: 619
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 619
Turkey, Izmir
Thanks again Grafton!
But child flags not working in the c-script.
VIEW ProjectionView =
{
material = mtlProjView;
flags = VISIBLE;
}
---------------------------------
< material = mtlProjView;>
Example.WDL 148:0 (): Keyword unknown ProjectionView material

< }>
Example.WDL 151:-1 (): Syntax error - ProjectionView
---------------------------------

Can somebody convert "example 5" to c-script please?

Re: Projective Texture Mapping - Spotlight Flashl [Re: Grafton] #181149
02/02/08 09:12
02/02/08 09:12
Joined: Mar 2005
Posts: 969
ch
Loopix Offline
User
Loopix  Offline
User

Joined: Mar 2005
Posts: 969
ch
Great contribution! Many have been waiting for something like this

Me too I'd be interested in a c-script working version! I'd compensate such a conversion by donating both my model packs to the "convertor"

Thanks!

Re: Projective Texture Mapping - Spotlight Flashl [Re: Loopix] #181150
02/02/08 11:09
02/02/08 11:09
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Thanks for your work.. this is awesome! I have some questions, though:

  • does the shader work for multiple projectors, too?
  • this is a perspective projector.. are you able to make an orthograpic projector as well?


Thanks for your work!!

Re: Projective Texture Mapping - Spotlight Flashl [Re: Grafton] #181151
02/02/08 12:45
02/02/08 12:45
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
cool, i'll try that when i get back to work ^_^

in the meantime im wondering, how can i change the colour of the shadow pixel?
(im on my laptop, which has shadows working, so i can develop a bit here )
I did find how i could change the environmental fog to be more dense etc, but not the shadow color... then again im a complete shader noob, and never worked in lite-c yet :O but this is so gonna get me started!!

again, thanks

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Projective Texture Mapping - Spotlight Flashl [Re: Helghast] #181152
02/03/08 16:42
02/03/08 16:42
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Tested it, it works great

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Page 2 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