Some tweaks
This commit is contained in:
parent
6ef1e1d938
commit
788bb78989
@ -46,10 +46,12 @@ if(${PLATFORM} MATCHES "Android")
|
||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_heightmap.c)
|
||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_billboard.c)
|
||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_rlgl_solar_system.c)
|
||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/models/models_obj_viewer.c)
|
||||
|
||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_custom_uniform.c)
|
||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_model_shader.c)
|
||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_postprocessing.c)
|
||||
list(REMOVE_ITEM example_sources ${CMAKE_CURRENT_SOURCE_DIR}/shaders/shaders_raymarching.c)
|
||||
|
||||
elseif(${PLATFORM} MATCHES "Web")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1")
|
||||
|
@ -407,6 +407,7 @@ EXAMPLES = \
|
||||
models/models_box_collisions \
|
||||
models/models_billboard \
|
||||
models/models_obj_loading \
|
||||
models/models_obj_viewing \
|
||||
models/models_heightmap \
|
||||
models/models_cubicmap \
|
||||
models/models_mesh_picking \
|
||||
@ -418,6 +419,7 @@ EXAMPLES = \
|
||||
shaders/shaders_shapes_textures \
|
||||
shaders/shaders_custom_uniform \
|
||||
shaders/shaders_postprocessing \
|
||||
shaders/shaders_raymarching \
|
||||
audio/audio_sound_loading \
|
||||
audio/audio_music_stream \
|
||||
audio/audio_module_playing \
|
||||
|
@ -32,9 +32,9 @@ int main()
|
||||
camera.target = (Vector3){ 0.0f, 0.0f, 0.7f }; // Camera looking at point
|
||||
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
|
||||
camera.fovy = 65.0f; // Camera field-of-view Y
|
||||
|
||||
|
||||
SetCameraMode(camera, CAMERA_FREE); // Set camera mode
|
||||
|
||||
|
||||
// Load raymarching shader
|
||||
// NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex shader
|
||||
Shader shader = LoadShader(0, "resources/shaders/glsl330/raymarching.fs");
|
||||
@ -46,12 +46,12 @@ int main()
|
||||
int deltaTimeLoc = GetShaderLocation(shader, "deltaTime");
|
||||
int runTimeLoc = GetShaderLocation(shader, "runTime");
|
||||
int resolutionLoc = GetShaderLocation(shader, "resolution");
|
||||
|
||||
|
||||
float resolution[2] = { screenWidth, screenHeight };
|
||||
SetShaderValue(shader, resolutionLoc, resolution, 2);
|
||||
|
||||
|
||||
float runTime = 0.0f;
|
||||
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
@ -61,14 +61,14 @@ int main()
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
UpdateCamera(&camera); // Update camera
|
||||
|
||||
|
||||
float cameraPos[3] = { camera.position.x, camera.position.y, camera.position.z };
|
||||
float cameraTarget[3] = { camera.target.x, camera.target.y, camera.target.z };
|
||||
float cameraUp[3] = { camera.up.x, camera.up.y, camera.up.z };
|
||||
|
||||
float deltaTime = GetFrameTime();
|
||||
runTime += deltaTime;
|
||||
|
||||
|
||||
// Set shader required uniform values
|
||||
SetShaderValue(shader, viewEyeLoc, cameraPos, 3);
|
||||
SetShaderValue(shader, viewCenterLoc, cameraTarget, 3);
|
||||
@ -86,9 +86,9 @@ int main()
|
||||
// We only draw a white full-screen rectangle,
|
||||
// frame is generated in shader using raymarching
|
||||
BeginShaderMode(shader);
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, WHITE);
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, WHITE);
|
||||
EndShaderMode();
|
||||
|
||||
|
||||
DrawText("(c) Raymarching shader by Iñigo Quilez. MIT License.", screenWidth - 280, screenHeight - 20, 10, GRAY);
|
||||
|
||||
EndDrawing();
|
||||
|
@ -2891,8 +2891,8 @@ int GetShaderLocation(Shader shader, const char *uniformName)
|
||||
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
||||
location = glGetUniformLocation(shader.id, uniformName);
|
||||
|
||||
if (location == -1) TraceLog(LOG_WARNING, "[SHDR ID %i] Shader uniform [%s] COULD NOT BE FOUND", shader.id, uniformName);
|
||||
else TraceLog(LOG_INFO, "[SHDR ID %i] Shader uniform [%s] set at location: %i", shader.id, uniformName, location);
|
||||
if (location == -1) TraceLog(LOG_WARNING, "[SHDR ID %i][%s] Shader uniform could not be found", shader.id, uniformName);
|
||||
else TraceLog(LOG_INFO, "[SHDR ID %i][%s] Shader uniform set at location: %i", shader.id, uniformName, location);
|
||||
#endif
|
||||
return location;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user