Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Evolved Shader and Lock Object On

Author
Message
Rims Flames
12
Years of Service
User Offline
Joined: 5th Apr 2014
Location:
Posted: 11th Sep 2014 00:22
Hey guyz,

I am using advanced lighting in my application and i want to place an object in front of my screen with lock object on but. I am positioning the object in front of the camera (camera position z plus extra coordinates) but i can\'t see the object. Is lock object on not compatible with screen shaders?

Thank You!

Rims Flames
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 11th Sep 2014 03:29
I haven't tried it but I wouldn't be surprised if it doesn't work together. AL uses multiple cameras and renders and I think lock object doesn't actually keep the object in the scene. You will probably need to update the object position manually to keep it in front of the camera actually in the scene.

Rims Flames
12
Years of Service
User Offline
Joined: 5th Apr 2014
Location:
Posted: 11th Sep 2014 13:58
I did that manually and it didn't worked

Rims Flames
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Sep 2014 17:21
Quote: "AL uses multiple cameras and renders and I think lock object doesn't actually keep the object in the scene."


I doubt that alone is the problem. The following simple demo works for me.



As you can see, the locked object is rendered correctly to image 1. Perhaps the object's information is being used incorrectly in one of the shaders?



Powered by Free Banners
Rims Flames
12
Years of Service
User Offline
Joined: 5th Apr 2014
Location:
Posted: 11th Sep 2014 17:35
lock object on 85
position object 85, camera position x(0), camera position y(0), camera position z(0) + 155


this is the simple code that i am doing to make the object appear but it doesn't. Here i think its about the shader itself!

Rims Flames
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 11th Sep 2014 23:06
That will only work when the camera faces directly out on the z axis, you need to position along a vector out in the direction the camera is pointing, and if doing it this way, no need to lock on.


Ill do some testing with AL and lock object later, they may end up working together, i haven't tried i just wouldn't be surprised if not. AL tends to want things it's own particular way

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Sep 2014 00:03
My guess, without looking at any code, is that any shader rendering the locked object would need to take account of the locking for that object in terms of its position, etc. I doubt AL allows for that option without modification. Once you've got the scene rendered to an image then you should be OK.



Powered by Free Banners
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 12th Sep 2014 03:01
Yeah that'd be my guess as well

Rims Flames
12
Years of Service
User Offline
Joined: 5th Apr 2014
Location:
Posted: 13th Sep 2014 13:48
I tried rendering to image but still no result. Is a way to lock the object screen or at least one secondary function that can immitate the lock object on command?

Thank You!

Rims Flames
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 13th Sep 2014 14:24
Hi there.
If trying to lock object on, is being a nightmare, why don't position object in the same coords of the camera ?

Something like this:



I'm not a grumpy grandpa
Rims Flames
12
Years of Service
User Offline
Joined: 5th Apr 2014
Location:
Posted: 13th Sep 2014 16:43
I already tried the code Chafari, but the weapon is facing in the wrong direction and i don't know how to rotate it to face the right direction.[img]null[/img]

Rims Flames
Rims Flames
12
Years of Service
User Offline
Joined: 5th Apr 2014
Location:
Posted: 13th Sep 2014 17:32
Never mind, sorry, i resolved it by initilizing the command turn object left and played with the values provided by you. The real problem is that when i am moving, the object will not stay in it's position lets say, if i am going forward, the weapon will go back a bit and when i am stopping, the weapon will go in the initial position. How can i resolve this issue?

Rims Flames
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 13th Sep 2014 22:53
Quote: "1 --the weapon is facing in the wrong direction and i don't know how to rotate it to face the right direction.

2 --if i am going forward, the weapon will go back a bit and when i am stopping, the weapon will go in the initial position
"


I think you could try instead to move object object after positioning in camera coords, you could adjust the offset to your gun object...the same with the gun rotation...you could adjust the object angle and then FIX OBJECT PIVOT .

I'm not a grumpy grandpa
Rims Flames
12
Years of Service
User Offline
Joined: 5th Apr 2014
Location:
Posted: 14th Sep 2014 12:00
Ok i resolved it thank you very much all!!!

Rims Flames

Login to post a reply

Server time is: 2026-07-18 17:20:57
Your offset time is: 2026-07-18 17:20:57