• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code Replacement for d3d_set_shading?

L

Lerner

Guest
Hello there!

I am creating a 3D game and I need to disable the gouraud shading that is applied on my 3D models, to get flat shading.

The left model of this example picture illustrates what I want:


In Game Maker : Studio 1 I can set the "d3d_set_shading(smoothing)" smoothing parameter to false, but in GameMaker Studio 2 the function does not exist anymore.

How can I achieve the same effect with GameMaker Studio 2?
 

DukeSoft

Member
I'm not sure if there is a replacement, but you can try to make a project in 1.4 that uses the d3d_set_shading() function, then import it into GM:S2, and see what it tells you. Maybe they have some kind of workaround compatibility script?
 
L

Lerner

Guest
I'm not sure if there is a replacement, but you can try to make a project in 1.4 that uses the d3d_set_shading() function, then import it into GM:S2, and see what it tells you. Maybe they have some kind of workaround compatibility script?
I already have imported an old project to get the compatibility script, but the said script just contains a warning message. :(
 

rwkay

GameMaker Staff
GameMaker Dev.
There is not a replacement for this as it the implementation is down to shaders and how the pixel shader inputs are set up

Russell
 

TheSnidr

Heavy metal viking dentist
GMC Elder
This can be done when creating the model, just make the model with flat normals in your model editor.
It can alternatively be done when importing it into GM by converting the vertex buffer to a normal buffer, modifying the normals and convert back to vertex buffer. This is a bit more complicated.
My model tool lets you switch between smooth and flat normals.
 
Top