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 / How to scale object in shader?

Author
Message
Kuper
17
Years of Service
User Offline
Joined: 25th Feb 2008
Playing: Planescape:Torment
Posted: 20th Dec 2015 22:59
How can I scale object in shader?
I need to set object scale manually by shader
revenant chaos
DBPro Master
18
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 21st Dec 2015 06:27 Edited at: 30th Dec 2015 03:10
Within the vertex shader, multiply the input position coordinates by your scale value (1.0 = 100%) before transforming them. For example: most vertex shaders contain a line somewhere along the lines of:

That line is responsible for transforming vertex position coordinates from object space into clip space. To add scaling, just multiply IN.Pos by your scaling value before its multiplied by the transformation matrix.

Kuper
17
Years of Service
User Offline
Joined: 25th Feb 2008
Playing: Planescape:Torment
Posted: 27th Dec 2015 11:10

Login to post a reply

Server time is: 2025-08-08 17:18:29
Your offset time is: 2025-08-08 17:18:29